Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if page.firstUpload == True:
- showMoreValue = int((podcastsValue - 6)/10)
- while showMoreValue > 0:
- params = {"offset": 6,
- "limit": 10}
- #Задаём параметры
- headers = {"Accept": "application/json",
- "Accept-Encoding": "gzip, deflate, br",
- "Accept-Language": "en-US,en;q=0.9,ru;q=0.8",
- "Authorization": ("Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IldlYlBsYXlLaWQifQ.eyJpc3MiOiJBTVBXZWJQbGF5IiwiaWF0IjoxNTYyNjIxNjY0LCJleHAiOjE1NzgxNzM2NjR9.xX_QTd05VtqhVJQlhmuDKbIkHVUJSSS4w8CR2fP_T0SRQbqmshLNDmcyb5827c3q7yfX2TNhpA2tFmW_NYwbJA").encode('utf-8'),
- "Connection": "keep-alive",
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
- "Host": "amp-api.podcasts.apple.com",
- "Origin": "https://podcasts.apple.com",
- "Referer": url,
- "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"}
- showMoreUrl = u"https://amp-api.podcasts.apple.com/v1/catalog/ru/podcasts/" + url.split("/")[-1].split("d")[-1] + u"/episodes"
- print(showMoreUrl)
- response = requests.get(showMoreUrl, params=params, headers=headers)
- print("Кул1")
- showMoreValue -= 1
- print("Кул")
- time.sleep(10)
- page.firstUpload = False
- page.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement