Skip to content

Commit 31d8ae2

Browse files
committed
No headers for request to p/youtube
1 parent c840cf8 commit 31d8ae2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/download.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@
5151
while url := data["next"]:
5252
n += 1
5353
pbar.update(1)
54-
response = requests.get(url, headers=headers)
54+
response = (
55+
requests.get(url)
56+
if resource_name == "youtube"
57+
else requests.get(url, headers=headers)
58+
)
5559

5660
if response.status_code != 200:
5761
raise Exception(f"Error {response.status_code}: {response.text}")

0 commit comments

Comments
 (0)