Copy online media to your USB pen by night and watch it on your daily commute

Overview

commute-tube

Build Status Coverage Status

commute-tube is your friend on your daily commute. It will download videos of your interest to your USB pen by night so that you're able to watch the program in bus or train. It is basically a configurable wrapper for youtube-dl.

I made this tool because I was getting a new job with a daily commute via train attached. On that train ride no cellular network nor wifi was available. Despite wifi was introduced to the trains in the mean time, commute-tube still holds up by giving me instant access to the videos I want to watch without thinking about bandwidth and spinning loading wheels.

commute-tube is a tool written in Python and should be run in a headless environment such as a server with a USB pen attached. It will look for your USB pen. The only thing that should be done regularly is to plug in your pen after work and catch it before you leave the house.

Alternatively, it is possible to just download to a folder and synch this folder via rsynch to your laptop or smart device.

Installation

End User

Run pip install commute-tube.

Development

Run pip install -e . in the checked out folder.

Running

By running commute-tube commute-tube will look for the configuration file (see below) and start downloading to the configured download location.

Configuration

See the example config.json file. The configuration is stored in $HOME/.config/commutetube/config.json.

The file already_downloaded.txt will hold all the files already downloaded. They won`t be downloaded in any following run.

pen section

In the pen section you may declare basic settings such as penPath (path to your pen), downloadFolder (the path where files are going be downloaded inside your penPath).

common subsection

The common subsection features settings that should be inheritet by all subsequent sources. Things like maximum download quality should be configured here.

source section

The source section contains all the various sources you want to download from. Besides description which contains a description of the source and shellscript all the parameters are basic youtube-dl options. See the youtube-dl implementation for a detailed overview over the parameters available and how to set them.

Shell script support

In addition to the youtube-dl wrapper it is possible to set the value shellscript which invokes a shell script or command that you specify and takes the output one line at a time for youtube-dl as input. This is helpful if you want to parse a video source that is not yet supported by youtube-dl.

For example, by this approach you can write a shellscript onliner which extracts a list of urls that is supported by youtube-dl.

The output of the shellscript is passed to youtube-dl.

File copy support

Basic files on your host file system are also supported. Use the path element for specifying a file to the USB pen. In order to avoid re copying of already copied files, files are checked for their checksum.

Changes to older versions

Both config.json and already_downloaded.txt are now stored in $HOME/.config/commutetube/. Their location can also be changed via command line arguments.

Best Practices

Here are some best practices listed that I've used on my daily commute ever since creating commute-tube.

Running commute-tube once every night

For my scenario I've created a Jenkins job that will trigger commute-tube every night at 4 am. The job does also do the following tasks and will upload the log file to an internet resource for me to monitor in case of something went wrong.

So far I was using two scenarios:

  1. Synch via wifi
  2. Copy to USB pen

Synching a folder to my laptop every morning

This one is my preferred way since it takes away the need to deal with a USB pen every day.

Instead I'm waking up my MacBook via a launchd job every morning and synch all the contents of the download folder via rsynch.

Working with a USB pen

Prior to the actual downloading, Jenkins also checks if the USB pen has been plugged in using the commute-tube --check command. If not plugged-in, Jenkins will remind me by sending a push notification to my phone.

Deleting contents of the USB pen

Eventually the disk space on your USB pen will run out. In my case I was using a Windows host system for watching the contents on my pen. I wrote a Windows batch file that moves all the contents of the Download folder of the pen to a sub folder called delete.

The nightly routine for starting commute-tube will then delete all the contents of the delete folder. This will also keep the files on the pen in case of error or when I forget to plug-in the pen.

Later I was switching over to a more automated process by writing something like this in my Jenkins job:

find /mnt/commute/Download/ -type f -mtime +7 -exec rm -v {} \;

This will delete all files older than 7 days.

Mount point for USB pen

Best way would be to use a FAT32 formatted USB pen. Since there is a good working and hassle free implementation of FAT32 on almost any Unix machine. At first you should create a mount point with mkdir /mnt/commuteUSB and after that configure /etc/fstab.

In order to do so, extract the UUID of your USB pen and put it into the /etc/fstab configuration. The user flag will allow any user to mount and unmount the pen by using mount /mnt/commuteUSB or umount /mnt/commuteUSB respectively:

[[email protected] ~]$ sudo blkid
/dev/sdd1: LABEL="KINGSTON" UUID="25E6-B035" TYPE="vfat" PARTUUID="c3072e18-01"
[[email protected] ~]$ cat /etc/fstab
UUID=25E6-B035    /mnt/commuteUSB  vfat   user,noauto,rw,umask=000              0  0

Mounting the USB pen

In earlier versions commute-tube brang it's own functionality for mounting and unmounting USB pens, I've found this behaviour rather unreliable compared to native mount mountpoint and umount mountpoint commands of the system. You'll be better of runnign something like:

mount mountpoint &&
commute-tube
unmount mountpoint ||
echo "Unable to unmount"
Owner
Matthias Küch
Bringing personal ideas to life here.
Matthias Küch
Pytube ve tkinter kütüphanesi ile yapmış olduğum basit ve temel bir youtube video indirme programı.

PyTube Pytube ve tkinter kütüphanesi ile yapmış olduğum basit ve temel bir youtube video indirme programı. Videolar 720p çözünürlükte indirilmektedir.

1 Nov 12, 2021
Python library to download bulk of images from Bing.com

Python library to download bulk of images form Bing.com. This package uses async url, which makes it very fast while downloading.

Guru Prasad Singh 105 Dec 14, 2022
Download a large file from Google Drive (curl/wget fails because of the security notice).

gdown Download a large file from Google Drive. Description Download a large file from Google Drive. If you use curl/wget, it fails with a large file b

Kentaro Wada 2.7k Jan 09, 2023
Youtube Downloader GUI

Python Youtube Downloader GUI This is a GUI application that allows you to download videos from Youtube. Features Download videos from Youtube in MP3

Daniel Carrillo 2 Dec 14, 2021
Python utility to download jobs at seek.com.au

Job Seeker job_seeker is an utility to download data of a job search from seek.com.au into a csv file for data analysis and exploration Install using

PyBites 3 May 14, 2022
Python Youtube Video-Playlist Downloader

Youtube-Video-Playlist-Downloader-PyQt5 You can download videos and playlists on YouTube with this script. Script has GUI. Enjoy. Setup git clone http

Yunus Emre Öztürk 2 Jun 06, 2022
A web app for downloading Facebook comments as a csv file

Facebook Comment Downloader A small web app for downloading comments from a public facebook page post. Comment downloading from https://github.com/min

WSDOT 23 Jan 04, 2023
A fast and small Torrent client made with Python 3.

pico-torrent A fast and small Torrent client made with Python 3. History and context It was programmed by a hacker known as Jazz_Man, around January o

Pindorama 9 Oct 04, 2022
A Python script to download PDB files associated with a Portable Executable (PE)

A Python script to download PDB files associated with a Portable Executable (PE)

Podalirius 33 Jan 03, 2023
Downloads photos you saved from a specific profile.

instagram-download-saved A python script that downloads photos you saved from a specific profile. The only dependency is instaloader, an open-source p

Aviv 1 Dec 19, 2021
Download songs and playlists from Spotify for free!

spotify-to-mp3-converter You can basically understand the process with just this image but for clarity, these are the steps. Before using the exe down

2 Jan 25, 2022
Download your Spotify playlists and songs along with album art and metadata

spotDL Download your Spotify playlists and songs along with album art and metadata The fastest, easiest, and most accurate command-line music download

10.6k Jan 03, 2023
YouTube-Downloader - YouTube Video Downloader made using python

YouTube-Downloader YouTube Videos Downloder made using python.

Shivam 1 Jan 16, 2022
Download all games from a public Itch.io Game Jam

Itch Jam Downloader Downloads all games from a public Itch.io Game Jam. What you'll need: Python 3.8+ pip install -r requirements.txt For site mirrori

Dragoon Aethis 19 Dec 07, 2022
Libretrofuzz - Fuzzy Retroarch thumbnail downloader

Fuzzy Retroarch thumbnail downloader In Retroarch, when you use the manual scann

8 Nov 26, 2022
Automatically download multiple papers by keywords in CVPR

Automatically download multiple papers by keywords in CVPR

46 Jun 08, 2022
YouTube to MP3 or 4, you get to choose...

UTubeToMP YouTube to MP3 or 4, you get to choose... If you don't wanna git clone andor dont wanna install python. Here: Repl.it Instructions: Pretty s

1 Jan 29, 2022
Download all posts and comments in a subreddit

subreddit downloader This subreddit downloader downloads all posts and comments in a subreddit For a tutorial to use this program please follow this m

Guneet 6 Dec 16, 2022
Organize your downloads easily with DownloadOrganizer

DownloadOrganizer Organize your downloads organize your downloads easily with DownloadOrganizer Instilation how to install DownloadOrganizer Method 1:

1 Dec 02, 2021
Tkinter based YouTube video downloader works on pytube 11.0.2. Can download YouTube videos in 720p(HD), 144p and even only audio.

YouTube-Downloader Tkinter based YouTube video downloader works on pytube 11.0.2. Can download YouTube videos in 720p(HD), 144p and even only audio. G

Manav Grover 2 Dec 27, 2021