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

port python parser for titan localhoster

Location:
titan/mediathek/localhoster
Files:
1 edited
1 moved

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
  • titan/mediathek/localhoster/vidup.py

    r38960 r38961  
    1 """
    2     urlresolver XBMC Addon
    3     Copyright (C) 2011 t0mm0
    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.
    9 
    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 
     2import sys
    193import re
    204from lib import jsunpack
    21 from urlresolver import common
    22 from urlresolver.resolver import UrlResolver, ResolverError
     5from net import Net
    236
    24 
    25 class VidUpMeResolver(UrlResolver):
     7class VidUpMeResolver(object):
    268    name = "vidup.me"
    279    domains = ["vidup.me", "beta.vidup.me"]
     
    2911
    3012    def __init__(self):
    31         self.net = common.Net()
     13        self.net = Net()
     14        url = str(sys.argv[1])
     15        host = self.get_host_and_id(url)[0]
     16        media_id = self.get_host_and_id(url)[1]
     17
     18        return self.get_media_url(host, media_id)
     19 
     20    def get_host_and_id(self, url):
     21        r = re.search(self.pattern, url, re.I)
     22        if r:
     23            return r.groups()
     24        else:
     25            return False
    3226
    3327    def get_media_url(self, host, media_id):
     
    4640            stream_url = re.findall('''['"]?file['"]?\s*:\s*['"]?([^'"]+)''', match[0])
    4741            if stream_url:
    48                 return stream_url[-1]
    49 
    50         raise ResolverError('File Not Found or removed')
     42                 print stream_url[-1]
    5143
    5244    def get_url(self, host, media_id):
    5345        return 'http://beta.vidup.me/embed-%s.html' % media_id
     46
     47
     48sys.stdout = VidUpMeResolver()
Note: See TracChangeset for help on using the changeset viewer.