Changeset 42584 for titan/mediathek


Ignore:
Timestamp:
Jul 29, 2018, 2:30:25 AM (16 months ago)
Author:
obi
Message:

fix streamcloud

Location:
titan/mediathek/localhoster
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/hoster.sh

    r42564 r42584  
    745745                vivo) vivo $INPUT;;
    746746                goldesel|movie4k|movie4kto|kinox|kinos|kinoxto|foxx) cloudflare $INPUT;;
    747                 streamcloud1) streamcloud $INPUT;;     
     747                streamcloud) streamcloud $INPUT;;       
    748748                nowvideo) nowvideo $INPUT;;
    749749                divxstage|cloudtime) divxstage $INPUT;;
  • titan/mediathek/localhoster/streamcloud.py

    r39238 r42584  
    22import re
    33import sys
     4import time
    45from lib.net import Net
     6import re, urllib, json
     7from lib import helpers
     8import lib.common as common
    59
    610class StreamcloudResolver(object):
     
    2630    def get_media_url(self, host, media_id):
    2731        web_url = self.get_url(host, media_id)
    28         resp = self.net.http_GET(web_url)
    29         html = resp.content
    30         post_url = resp.get_url()
     32        headers = {'User-Agent': common.FF_USER_AGENT}
     33        response = self.net.http_GET(web_url, headers=headers)
     34        html = response.content
    3135        if re.search('>(File Not Found)<', html):
    32             print 'File Not Found or removed'
     36            raise ResolverError('File Not Found or removed')
    3337
    34         form_values = {}
    35         for i in re.finditer('<input.*?name="(.*?)".*?value="(.*?)">', html):
    36             form_values[i.group(1)] = i.group(2).replace("download1", "download2")
    37         html = self.net.http_POST(post_url, form_data=form_values).content
     38        cnt = 10
     39        match = re.search('count\s*=\s*(\d+);', html)
     40        if match:
     41            cnt = int(match.group(1))
     42        cnt += 1
    3843
    39         r = re.search('file: "(.+?)",', html)
    40         if r:
    41             print r.group(1)
     44        data = helpers.get_hidden(html)
     45        headers.update({'Referer': web_url})
     46#        common.kodi.sleep(cnt * 1000)
     47        time.sleep(10)
     48        html = self.net.http_POST(response.get_url(), form_data=data, headers=headers).content
     49        sources = helpers.scrape_sources(html, patterns=['''file\s*:\s*["'](?P<url>[^"']+)'''])
     50#        return helpers.pick_source(sources) + helpers.append_headers(headers)
     51        print helpers.pick_source(sources) + helpers.append_headers(headers)
     52#        print "%s%s" % (helpers.pick_source(sources), helpers.append_headers(headers))
     53
    4254
    4355    def get_url(self, host, media_id):
Note: See TracChangeset for help on using the changeset viewer.