4 ms·
I'm running what basically a prepaid SIM, meaning I don't use mobile data. Thus I do use yt-dlp/youtube-dl to download music so that I can listen to it offline.
by LoveMortuus 5y ago
I'm running what basically a prepaid SIM, meaning I don't use mobile data. Thus I do use yt-dlp/youtube-dl to download music so that I can listen to it offline. I'm actually quite proud by the system I've set up.
I've got a playlist called music into which I add music. ^^
On my mobile phone I've got Termux with an add-on that allows you to add widgets that run custom code.
I've written a simple script ( yt-dlp -P ~/storage/shared/Music -i -o "%(title)s.%(ext)s" --no-restrict-filenames --download-archive ~/music_archive.txt -x --audio-quality 0 <link to the playlist> ). Which is ran whenever I press on the widget. I could use crontab, but since I don't add music that often, I prefer to do it manually. ( The -o is for file name, normally the file would have the same name as the source, but for unknown reason so of my files' names for restricted to ~40 chars, doing it the way you see above solves the issue).
Before this system I used to have a similar script on my PC and crontab running it. The script downloaded music into Google Drive and on the mobile phone I had a program that would sync that folder with music to the phones music folder.
But the current system is far superior, for one it doesn't fill up my Google Drive and secondly it doesn't require multiple devices to work.
Being able to use a terminal on my phone makes me really happy! ^^
- brokenmachine 5y agoWhat's the add-on? So when you press the widget it runs yt-dlp on your phone, or is it sending a command to a remote PC?
- LoveMortuus 5y agoThe add-on is called Widget, your can find it by googling Termux Widget. When I press on the widget it runs yt-dlp on my phone. There are no other devices involved in the process, just my phone.
- brokenmachine 5y agoOh cool, I didn't realize yt-dlp would run on Android.