Skip to content

Instantly share code, notes, and snippets.

@Teeed
Last active January 8, 2020 07:51
Show Gist options
  • Save Teeed/2d922033f5776d5961116f39cec8e02d to your computer and use it in GitHub Desktop.
Save Teeed/2d922033f5776d5961116f39cec8e02d to your computer and use it in GitHub Desktop.
Generates link list from media.ccc.de playlist
FROM python:3
WORKDIR /app
COPY requirements.txt .
RUN ["pip", "install", "-r", "requirements.txt"]
COPY main.py .
CMD ["python3", "main.py"]
# Generates link list from media.ccc.de playlist
# Could be found in upper part of media list (https://media.ccc.de/c/36c3) look for "Full playlist"
PLAYLIST_URL = 'https://media.ccc.de/v/36c3-55-gefragt-gejagt-junghacker-innen-edition/playlist'
import requests
from bs4 import BeautifulSoup
r = requests.get(PLAYLIST_URL)
assert r.status_code == 200
soup = BeautifulSoup(r.text, 'html.parser')
for source in soup.find_all('source'):
lang = source.get('data-lang')
if lang != 'eng': # filter only english talks
continue
src = source.get('src')
print(src)
requests==2.22.0
beautifulsoup4==4.8.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment