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
# install miniconda | |
cd | |
wget http://repo.continuum.io/miniconda/Miniconda-3.5.5-Linux-armv6l.sh | |
md5sum Miniconda-3.5.5-Linux-armv6l.sh | |
bash Miniconda-3.5.5-Linux-armv6l.sh -b | |
rm -rf Miniconda-3.5.5-Linux-armv6l.sh | |
echo 'export PATH=/home/pi/miniconda/bin:$PATH' >> .bashrc | |
source .bashrc | |
conda install pip --yes | |
conda install ipython --yes |
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
import urllib | |
import json | |
from bs4 import BeautifulSoup | |
from collections import namedtuple | |
Video = namedtuple("Video", "video_id title duration views thumbnail") | |
def parse_video_div(div): | |
video_id = div.get("data-context-item-id", "") | |
title = div.find("a", "yt-uix-tile-link").text |