Skip to content

Commit a08914e

Browse files
Merge pull request #6 from pyladies/add-youtube-urls-to-sessions
Download youtube urls from pretalx and add them to each session
2 parents 0dd8fa1 + d5c99ac commit a08914e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
uses: astral-sh/setup-uv@v7
3737

3838
- name: Download data
39-
run: uv run make download EXCLUDE="youtube" > /dev/null 2>&1
39+
run: uv run make download > /dev/null 2>&1
4040
env:
4141
PRETALX_TOKEN: ${{ secrets.PRETALX_TOKEN }}
4242

4343
- name: Transform data
44-
run: uv run make transform EXCLUDE="youtube" > /dev/null 2>&1
44+
run: uv run make transform > /dev/null 2>&1
4545

4646
- name: Create index.html
4747
run: |

src/download.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,21 @@
5353

5454
pbar = tqdm(desc=f"Downloading {resource_name}", unit=" page", dynamic_ncols=True)
5555

56+
# Don't send auth token for youtube resource
57+
# For some reason Pretalx API rejects it with a HTTP 403
58+
request_headers = (
59+
headers
60+
if resource_name != "youtube"
61+
else {
62+
"Accept": "application/json, text/javascript",
63+
"Pretalx-Version": Config.api_version,
64+
}
65+
)
66+
5667
while url := data["next"]:
5768
n += 1
5869
pbar.update(1)
59-
response = requests.get(url, headers=headers)
70+
response = requests.get(url, headers=request_headers)
6071

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

0 commit comments

Comments
 (0)