Changeset 39354
- Timestamp:
- 11/19/16 16:32:54 (7 years ago)
- Location:
- titan/mediathek/localhoster
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localhoster/hoster.sh
r39267 r39354 132 132 } 133 133 134 vidzi() 135 { 136 $BIN $CMD/vidzi.py $INPUT 137 } 138 134 139 if [ "$TYPE" == "get" ];then 135 140 case $hoster in … … 152 157 wholecloud) movshare $INPUT;; 153 158 vidgg) movshare $INPUT;; 159 vidzi) vidzi $INPUT;; 154 160 streamcloud1) streamcloud $INPUT;; 155 161 esac -
titan/mediathek/localhoster/lib/helpers.py
r39352 r39354 24 24 #from urlresolver.resolver import ResolverError 25 25 import common 26 from net import Net 26 27 27 28 def get_hidden(html, form_id=None, index=None, include_submit=True): … … 149 150 try: source_list.sort(key=lambda x: int(x[0]), reverse=True) 150 151 except: 151 common.log_utils.log_debug('Scrape sources sort failed |int(x[0])|') 152 test = 1 153 # common.log_utils.log_debug('Scrape sources sort failed |int(x[0])|') 152 154 try: source_list.sort(key=lambda x: int(x[0][:-1]), reverse=True) 153 155 except: 154 common.log_utils.log_debug('Scrape sources sort failed |int(x[0][:-1])|') 156 test = 2 157 # common.log_utils.log_debug('Scrape sources sort failed |int(x[0][:-1])|') 155 158 156 159 return source_list … … 164 167 165 168 result_blacklist = list(set(result_blacklist + ['.smil'])) # smil(not playable) contains potential sources, only blacklist when called from here 166 net = common.Net()169 net = Net() 167 170 parsed_url = urlparse(url) 168 171 headers = {'User-Agent': common.FF_USER_AGENT, … … 170 173 171 174 response = net.http_GET(url, headers=headers) 172 response_headers = response.get_headers(as_dict=True) 175 # response_headers = response.get_headers(as_dict=True) 176 response_headers = response.get_headers() 177 173 178 headers.update({'Referer': url}) 174 cookie = response_headers.get('Set-Cookie', None)175 if cookie:176 headers.update({'Cookie': cookie})179 # cookie = response_headers.get('Set-Cookie', None) 180 # if cookie: 181 # headers.update({'Cookie': cookie}) 177 182 html = response.content 178 183 179 184 source_list = scrape_sources(html, result_blacklist) 180 185 source = pick_source(source_list) 181 return source + append_headers(headers)186 return source# + append_headers(headers) -
titan/mediathek/localhoster/movshare.py
r39352 r39354 6 6 from lib.net import Net 7 7 from lib import helpers 8 import lib.common as common 8 9 9 10 class MovshareResolver(object): … … 51 52 headers.update({'Referer': web_url, }) 52 53 print stream_url + helpers.append_headers(headers) 54 # else: 55 # raise ResolverError('File Not Found or removed') 53 56 54 57 def get_url(self, host, media_id): 55 58 if 'vidgg' in host: 56 template = 'http://{host}/embed/?id={media_id}' 59 return 'http://%s/embed/?id=%s' % (host, media_id) 60 # template = 'http://{host}/embed/?id={media_id}' 57 61 else: 58 template = 'http://{host}/embed/?v={media_id}' 62 return 'http://%s/embed/?v=%s' % (host, media_id) 63 # template = 'http://{host}/embed/?v={media_id}' 59 64 print self._default_get_url(host, media_id, template) 60 65 -
titan/mediathek/localhoster/vidzi.py
r39052 r39354 43 43 print r.group(1) 44 44 45 print 'Unable to locate link'45 # print 'Unable to locate link' 46 46 47 47 def get_url(self, host, media_id):
Note: See TracChangeset
for help on using the changeset viewer.