Changeset 44467


Ignore:
Timestamp:
01/01/20 21:14:01 (3 years ago)
Author:
obi
Message:

fix

File:
1 edited

Legend:

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

    r44466 r44467  
    66import lib.common as common
    77import re
     8import lib.cloudflare as cloudflare
    89
    910class CloudflareResolver(object):
     
    2324                   'Content-Type': 'text/html; charset=utf-8'}
    2425
    25 #        html = self.net.http_GET(web_url, headers=headers).content
    26         #html = self.request(web_url, cookie_file=/mnt/network/cookies, cloudflare=True)
    27 #        ret = self.net.save_cookies('/mnt/network/cookies')     
    28 #        print "html", html.encode('utf8')
    2926
    3027#        print "cloudflare.CheckIfActive: ", web_url
    31         CF = cloudflare.CloudflareBypass()
    32         html = CF.GetHtml(web_url)
    33         print CF.GetReponseInfo()
    34         print "html", html
     28
     29        try:
     30            CF = cloudflare.CloudflareBypass()
     31            html = CF.GetHtml(web_url)
     32            print CF.GetReponseInfo()
     33            print "html", html
     34        except:
     35            html = self.net.http_GET(web_url, headers=headers).content
     36            #html = self.request(web_url, cookie_file=/mnt/network/cookies, cloudflare=True)
     37            ret = self.net.save_cookies('/mnt/network/cookies')     
     38            print "html", html.encode('utf8')
    3539
    3640sys.stdout = CloudflareResolver()
Note: See TracChangeset for help on using the changeset viewer.