Changeset 39075


Ignore:
Timestamp:
09/29/16 01:26:33 (8 years ago)
Author:
obi
Message:

tithek fix flashx

Location:
titan/mediathek/localhoster
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/flashx.py

    r38996 r39075  
    44import sys
    55from lib.net import Net
     6import lib.common as common
    67
    78class FlashxResolver(object):
     
    3334        file_id = re.search("'file_id', '(.*?)'", html).group(1)
    3435        aff = re.search("'aff', '(.*?)'", html).group(1)
    35         headers = { 'Referer': web_url,
    36                     'Cookie': '__cfduid=' + cfduid + '; lang=1'}
    37         surl = re.search('src="(.*?' + file_id + ')',html).group(1)
     36        headers = {'User-Agent': common.IE_USER_AGENT,
     37                   'Referer': web_url,
     38                   'Cookie': '__cfduid=' + cfduid + '; lang=1'}
     39        surl = re.search('src="(.*?' + file_id + ')', html, re.IGNORECASE).group(1)
    3840        dummy = self.net.http_GET(url=surl, headers=headers).content
    39         headers = { 'Referer': web_url,
    40                     'Cookie': '__cfduid=' + cfduid + '; lang=1; file_id=' + file_id + '; aff=' + aff }
     41        headers = {'User-Agent': common.IE_USER_AGENT,
     42                   'Referer': web_url,
     43                   'Cookie': '__cfduid=' + cfduid + '; lang=1; file_id=' + file_id + '; aff=' + aff}
    4144        html = self.net.http_GET(url=web_url, headers=headers).content
    4245        fname = re.search('name="fname" value="(.*?)"', html).group(1)
    4346        hash = re.search('name="hash" value="(.*?)"', html).group(1)
    44         fdata = { 'op': 'download1',
    45                   'usr_login': '',
    46                   'id': media_id,
    47                   'fname': fname,
    48                   'referer': '',
    49                   'hash': hash,
    50                   'imhuman': 'Proceed to video' }
    51         furl = 'http://www.flashx.tv/dl?' + media_id
     47        fdata = {'op': 'download1',
     48                 'usr_login': '',
     49                 'id': media_id,
     50                 'fname': fname,
     51                 'referer': '',
     52                 'hash': hash,
     53                 'imhuman': 'Proceed to video'}
     54        furl = 'http://www.flashx.tv/dl'# + media_id
    5255        time.sleep(5)
    5356        html = self.net.http_POST(url=furl, form_data=fdata, headers=headers).content
    54         strhtml = jsunpack.unpack(re.search('(eval\(function.*?)</script>', html, re.DOTALL).group(1))
    55         stream = re.search('file:"([^"]*)",label', strhtml).group(1)
    5657
     58        js_data = re.findall('(eval\(function.*?)</script>', html.replace('\n', ''))
     59
     60        for i in js_data:
     61            try: html += jsunpack.unpack(i)
     62            except: pass
     63
     64        stream = re.search('file:"([^"]*/high.*)",label', html).group(1)
    5765        if stream:
    5866            print stream
     67        else:
     68            stream = re.search('file:"([^"]*/normal.*)",label', html).group(1)
     69            if stream:
     70                print stream
     71            else:
     72                stream = re.search('file:"([^"]*/low.*)",label', html).group(1)
     73                if stream:
     74                    print stream
     75                else:
     76                    stream = re.search('file:"([^"]*)",label', html).group(1)
     77                    if stream:
     78                        print stream
    5979
    6080    def get_url(self, host, media_id):
  • titan/mediathek/localhoster/hoster.sh

    r39052 r39075  
    88BOX=`cat /etc/model`
    99debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
    10 curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
     10curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36'"
    1111if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
    1212wgetbin="wget -q -T2"
Note: See TracChangeset for help on using the changeset viewer.