Download audo and video files with an XMPP interface.
This bot has two main modes of operation:
- Send the bot an Youtube link, it downloads the video to a pre-set directory on your server. Add videos to your collection on the go.
- Send the bot an Youtube link, it extracts audio and sends you an MP3 file via XMPP (HTTP upload). Fetch MP3 files to your mobile even when Newpipe fails you.
-
Install: xmpppy, requests and youtube-dl.
sudo apt install python-xmpp python-requests python-pip sudo pip install youtube-dl
-
Create an XMPP account for your bot. Use a server which supports XEP-0363 HTTP Upload. Consult https://compliance.conversations.im/
-
Copy
settings.py-example
tosettings.py
and edit the file. -
Run the script
python bot.py
-
Set up a cron job to update youtube-dl
43 7 * * * pip install --upgrade youtube-dl
-
Optionally: make it run on startup. Systemd file is attached, for other process supervisor systems: PRs welcome.
Log into your XMPP bot's account and add your main account to the roster. Only people from the roster are allowed to use the bot.
Send the bot a link from your XMPP client. The bot supports an impressive number of video hosting websites via youtube-dl: https://rg3.github.io/youtube-dl/supportedsites.html
It's single threaded. Downloading more than one video at once will cause unpredictable effects.