Changeset 39400 for titan/mediathek


Ignore:
Timestamp:
12/02/16 23:31:14 (7 years ago)
Author:
tt4sk
Message:

First call of goldesel.to with goldesel.py / net.py, store cookie in /mnt/network/cookies, following calls with curl using same cookie and user agent.

Location:
titan/mediathek
Files:
4 edited

Legend:

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

    r39387 r39400  
    1212
    1313    def __init__(self):
    14 #        self.net = Net(cookie_file='/mnt/network/cookie', http_debug=True, cloudflare=True)
    15         self.net = Net(cookie_file='/mnt/network/cookie', cloudflare=True)
     14#        self.net = Net(cookie_file='/mnt/network/cookies', http_debug=True, cloudflare=True)
     15        self.net = Net(cookie_file='/mnt/network/cookies', cloudflare=True)
    1616        url = str(sys.argv[1])
    1717        return self.get_answer_code(url)
     
    2020        headers = {'User-Agent': common.FF_USER_AGENT}                 
    2121        html = self.net.http_GET(web_url, headers=headers).content
    22         #html = self.request(web_url, cookie_file=/mnt/network/cookie, cloudflare=True)
     22        #html = self.request(web_url, cookie_file=/mnt/network/cookies, cloudflare=True)
     23        ret = self.net.save_cookies('/mnt/network/cookies')     
    2324        print "html", html.encode('utf8')
    2425
  • titan/mediathek/localhoster/hoster.sh

    r39391 r39400  
    1010BOX=`cat /etc/model`
    1111debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
    12 curlbin="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'"
     12curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'"
    1313curlbin2='curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
    1414if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
  • titan/mediathek/localhoster/lib/net.py

    r39388 r39400  
    5151    ANDROID_USER_AGENT = 'Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36'
    5252
    53     _cj = cookielib.LWPCookieJar()
     53    _cj = cookielib.MozillaCookieJar()
    5454
    5555    _proxy = None
     
    8787
    8888        # empty jar for each instance rather than scope of the import
    89         self._cloudflare_jar = cookielib.LWPCookieJar()
     89        self._cloudflare_jar = cookielib.MozillaCookieJar()
    9090
    9191        self.cloudflare = cloudflare
     
    170170
    171171        if cloudflare_jar:
    172             self._cloudflare_jar = cookielib.LWPCookieJar()
     172            self._cloudflare_jar = cookielib.MozillaCookieJar()
    173173            jar = self._cloudflare_jar
    174174        else:
  • titan/mediathek/localparser_secret/goldesel.sh

    r39387 r39400  
    163163                rm $TMP/$PARSER.$INPUT.list
    164164        fi
    165 #       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
    166         /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$PARSER.$INPUT.1
     165        $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1 -A 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
     166#       /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$PARSER.$INPUT.1
    167167
    168168        cat $TMP/cache.$PARSER.$INPUT.1 | sed 's!<h2>Stream-Links</h2>!\nfound=!g' | sed 's!<h2>Sample-Links</h2>!\nerror=!g' | grep ^found= | sed 's/<li data=/\ndata=/g' | grep ^data= >$TMP/cache.$PARSER.$INPUT.2
     
    184184{
    185185        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
    186         $curlbin $URL/res/links -X POST --data "$PAGE" -o $TMP/cache.$PARSER.$INPUT.1
     186        $curlbin $URL/res/links -X POST --data "$PAGE" -o $TMP/cache.$PARSER.$INPUT.1 -A 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
    187187        STREAMURL=`cat $TMP/cache.$PARSER.$INPUT.1 | sed 's!url="http://dref.me/?!\nstreamurl="!' | grep ^streamurl= | cut -d'"' -f2 | sed 's!%3A!:!g' | sed 's!%2F!/!g'`
    188188#       rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
Note: See TracChangeset for help on using the changeset viewer.