Exemplo n.º 1
0
 def get_tokens(self, threadName):
     if requestsModule and cfscrapeModule:
         printl("Calling thread: %s" % threadName, self, 'A')
         global free_ck
         global free_agent
         if free_ck == {} or free_agent == '':
             free_ck, free_agent = cfscrape.get_tokens(BASE_URL)
             requests.cookies.cookiejar_from_dict(free_ck,
                                                  cookiejar=free_cookies)
         else:
             try:
                 s = requests.session()
                 url = urlparse.urlparse(BASE_URL)
                 headers = {'user-agent': free_agent}
                 page = s.get(url.geturl(),
                              cookies=free_cookies,
                              headers=headers,
                              timeout=15,
                              allow_redirects=False)
                 if page.status_code == 503 and page.headers.get(
                         "Server", ""
                 ).startswith(
                         "cloudflare"
                 ) and b"jschl_vc" in page.content and b"jschl_answer" in page.content:
                     free_ck, free_agent = cfscrape.get_tokens(BASE_URL)
                     requests.cookies.cookiejar_from_dict(
                         free_ck, cookiejar=free_cookies)
             except:
                 pass
         self.keyLocked = False
         reactor.callFromThread(self.getGenres)
     else:
         reactor.callFromThread(self.free_error)
Exemplo n.º 2
0
 def get_tokens(self, threadName):
     if requestsModule and cfscrapeModule:
         printl("Calling thread: %s" % threadName, self, 'A')
         global tat_ck
         global tat_agent
         if tat_ck == {} or tat_agent == '':
             tat_ck, tat_agent = cfscrape.get_tokens(BASE_URL)
             requests.cookies.cookiejar_from_dict(tat_ck,
                                                  cookiejar=tat_cookies)
         else:
             s = requests.session()
             url = urlparse.urlparse(BASE_URL)
             headers = {'user-agent': tat_agent}
             page = s.get(url.geturl(),
                          cookies=tat_cookies,
                          headers=headers,
                          allow_redirects=False)
             if page.status_code == 503 and page.headers.get(
                     "Server") == "cloudflare-nginx":
                 tat_ck, tat_agent = cfscrape.get_tokens(BASE_URL)
                 requests.cookies.cookiejar_from_dict(tat_ck,
                                                      cookiejar=tat_cookies)
         self.keyLocked = False
         reactor.callFromThread(self.getPage)
     else:
         reactor.callFromThread(self.tat_error)
Exemplo n.º 3
0
 def get_tokens(self, threadName):
     if requestsModule and cfscrapeModule:
         printl("Calling thread: %s" % threadName, self, 'A')
         global ss_ck
         global ss_agent
         if ss_ck == {} or ss_agent == '':
             ss_ck, ss_agent = cfscrape.get_tokens(BASE_URL)
             requests.cookies.cookiejar_from_dict(ss_ck,
                                                  cookiejar=ss_cookies)
         else:
             try:
                 s = requests.session()
                 url = urlparse.urlparse(BASE_URL)
                 headers = {'user-agent': ss_agent}
                 page = s.get(url.geturl(),
                              cookies=ss_cookies,
                              headers=headers)
                 if page.status_code == 503 and page.headers.get(
                         "Server", ""
                 ).startswith(
                         "cloudflare"
                 ) and b"jschl_vc" in page.content and b"jschl_answer" in page.content:
                     ss_ck, ss_agent = cfscrape.get_tokens(BASE_URL)
                     requests.cookies.cookiejar_from_dict(
                         ss_ck, cookiejar=ss_cookies)
             except:
                 pass
         if self.username != "ssEmail" and self.password != "ssPassword":
             self.Login()
         else:
             self.keyLocked = False
         reactor.callFromThread(self.showInfos)
     else:
         reactor.callFromThread(self.ss_error)
Exemplo n.º 4
0
	def get_tokens(self, threadName):
		if requestsModule and cfscrapeModule:
			printl("Calling thread: %s" % threadName,self,'A')
			global mfmp3_ck
			global mfmp3_agent
			if mfmp3_ck == {} or mfmp3_agent == '':
				mfmp3_ck, mfmp3_agent = cfscrape.get_tokens(BASE_URL)
				requests.cookies.cookiejar_from_dict(mfmp3_ck, cookiejar=mfmp3_cookies)
			else:
				s = requests.session()
				url = urlparse.urlparse(BASE_URL)
				headers = {'user-agent': mfmp3_agent}
				page = s.get(url.geturl(), cookies=mfmp3_cookies, headers=headers)
				if page.status_code == 503 and page.headers.get("Server") == "cloudflare-nginx":
					mfmp3_ck, mfmp3_agent = cfscrape.get_tokens(BASE_URL)
					requests.cookies.cookiejar_from_dict(mfmp3_ck, cookiejar=mfmp3_cookies)
			reactor.callFromThread(self.mh_initMenu)
		else:
			reactor.callFromThread(self.mh_errorMenu)