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

port python parser for titan localhoster

File:
1 moved

Legend:

Unmodified
Added
Removed
  • 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.