fix redirect with is_shorts
This commit is contained in:
parent
40beb35f34
commit
7111fedd5c
|
@ -140,8 +140,9 @@ def get_mapping() -> dict:
|
|||
def is_shorts(youtube_id: str) -> bool:
|
||||
"""check if youtube_id is a shorts video, bot not it it's not a shorts"""
|
||||
shorts_url = f"https://www.youtube.com/shorts/{youtube_id}"
|
||||
cookies = {"SOCS": "CAI"}
|
||||
response = requests.head(
|
||||
shorts_url, headers=requests_headers(), timeout=10
|
||||
shorts_url, cookies=cookies, headers=requests_headers(), timeout=10
|
||||
)
|
||||
|
||||
return response.status_code == 200
|
||||
|
|
Loading…
Reference in New Issue