Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.50 KB | None | 0 0
  1. if page.firstUpload == True:
  2.     showMoreValue = int((podcastsValue - 6)/10)
  3.     while showMoreValue > 0:
  4.         params = {"offset": 6,
  5.                   "limit": 10}
  6.         #Задаём параметры
  7.  
  8.         headers = {"Accept": "application/json",
  9.                    "Accept-Encoding": "gzip, deflate, br",
  10.                    "Accept-Language": "en-US,en;q=0.9,ru;q=0.8",
  11.                    "Authorization": ("Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IldlYlBsYXlLaWQifQ.eyJpc3MiOiJBTVBXZWJQbGF5IiwiaWF0IjoxNTYyNjIxNjY0LCJleHAiOjE1NzgxNzM2NjR9.xX_QTd05VtqhVJQlhmuDKbIkHVUJSSS4w8CR2fP_T0SRQbqmshLNDmcyb5827c3q7yfX2TNhpA2tFmW_NYwbJA").encode('utf-8'),
  12.                    "Connection": "keep-alive",
  13.                    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
  14.                    "Host": "amp-api.podcasts.apple.com",
  15.                    "Origin": "https://podcasts.apple.com",
  16.                    "Referer": url,
  17.                    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 OPR/62.0.3331.72"}
  18.  
  19.         showMoreUrl = u"https://amp-api.podcasts.apple.com/v1/catalog/ru/podcasts/" + url.split("/")[-1].split("d")[-1] + u"/episodes"
  20.         print(showMoreUrl)
  21.         response = requests.get(showMoreUrl, params=params, headers=headers)
  22.         print("Кул1")
  23.         showMoreValue -= 1
  24.         print("Кул")
  25.         time.sleep(10)
  26.     page.firstUpload = False
  27.     page.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement