Ignore:
Timestamp:
12/02/16 23:31:14 (5 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/localhoster
Files:
3 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:
Note: See TracChangeset for help on using the changeset viewer.