Ignore:
Timestamp:
09/23/16 18:43:31 (5 years ago)
Author:
obi
Message:

port python parser for titan localhoster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/nosvideo.py

    r38960 r38961  
    1 '''
    2 Nosvideo urlresolver plugin
    3 Copyright (C) 2013 Vinnydude
    41
    5 This program is free software: you can redistribute it and/or modify
    6 it under the terms of the GNU General Public License as published by
    7 the Free Software Foundation, either version 3 of the License, or
    8 (at your option) any later version.
     2import sys
     3import re
     4from net import Net
    95
    10 This program is distributed in the hope that it will be useful,
    11 but WITHOUT ANY WARRANTY; without even the implied warranty of
    12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    13 GNU General Public License for more details.
    14 
    15 You should have received a copy of the GNU General Public License
    16 along with this program. If not, see <http://www.gnu.org/licenses/>.
    17 '''
    18 
    19 import re
    20 from urlresolver import common
    21 from urlresolver.resolver import UrlResolver, ResolverError
    22 
    23 class NosvideoResolver(UrlResolver):
     6class NosvideoResolver(object):
    247    name = "nosvideo"
    258    domains = ["nosvideo.com", "noslocker.com"]
     
    2710
    2811    def __init__(self):
    29         self.net = common.Net()
     12        self.net = Net()
     13        url = str(sys.argv[1])
     14        host = self.get_host_and_id(url)[0]
     15        media_id = self.get_host_and_id(url)[1]
     16
     17        return self.get_media_url(host, media_id)
     18
     19    def get_host_and_id(self, url):
     20        r = re.search(self.pattern, url, re.I)
     21        if r:
     22            return r.groups()
     23        else:
     24            return False
    3025
    3126    def get_media_url(self, host, media_id):
     
    5146        stream_url = '%s playpath=%s' % (streamer, playpath)
    5247
    53         return stream_url
     48        print stream_url
    5449
    5550    def get_url(self, host, media_id):
    5651        return 'http://nosvideo.com/%s' % media_id
    5752
     53sys.stdout = NosvideoResolver()
     54
Note: See TracChangeset for help on using the changeset viewer.