Last active
January 8, 2020 07:51
-
-
Save Teeed/2d922033f5776d5961116f39cec8e02d to your computer and use it in GitHub Desktop.
Generates link list from media.ccc.de playlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
WORKDIR /app | |
COPY requirements.txt . | |
RUN ["pip", "install", "-r", "requirements.txt"] | |
COPY main.py . | |
CMD ["python3", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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