How to use indirect links in requests python

Viewed 88
I want to get a direct link for YouTube videos from https://vid.puffyan.us
I found a way to get a direct link from this site and it works well in the browser but this method does not work with requests in Python.
For example, I run the following link in the browser and it gives me a direct link to the file in the browser's address bar.
https://vid.puffyan.us/latest_version?id=rdGVZ48TsrQ&itag=22
But I send this link in requests and I do not receive a response.
import requests as r

r.get('https://vid.puffyan.us/latest_version?id=rdGVZ48TsrQ&itag=22')
How do I get a direct link with Python?
Due to the filtering of YouTube in my country, I can not use packages like pytube.
thank you for your help.
0 Answers
Related