Changeset 38961 for titan/mediathek/localhoster/nosvideo.py
- Timestamp:
- 09/23/16 18:43:31 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localhoster/nosvideo.py
r38960 r38961 1 '''2 Nosvideo urlresolver plugin3 Copyright (C) 2013 Vinnydude4 1 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. 2 import sys 3 import re 4 from net import Net 9 5 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): 6 class NosvideoResolver(object): 24 7 name = "nosvideo" 25 8 domains = ["nosvideo.com", "noslocker.com"] … … 27 10 28 11 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 30 25 31 26 def get_media_url(self, host, media_id): … … 51 46 stream_url = '%s playpath=%s' % (streamer, playpath) 52 47 53 returnstream_url48 print stream_url 54 49 55 50 def get_url(self, host, media_id): 56 51 return 'http://nosvideo.com/%s' % media_id 57 52 53 sys.stdout = NosvideoResolver() 54
Note: See TracChangeset
for help on using the changeset viewer.