diff --git a/README.md b/README.md index 14c38bc..a82bf79 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ **A tool that synchronizes your YouTube playlists and other music providers with your Cloud Storage like Nextcloud as MP3s.** ### What does it do? ✨ -- 🎵 Downloads your music from YouTube, SoundCloud [and many more](http://ytdl-org.github.io/youtube-dl/supportedsites.html) +- 🎵 Downloads your music from YouTube, SoundCloud [and many more](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) - 😁 Automatically monitors your playlists for newly added music - 🔄 Converts video files to the highest quality MP3 possible -  ☁  Uploads your music as MP3 to your Cloud Storage account. Supports all Cloud providers with WebDAV compatibility: Nextcloud, ownCloud, pCloud, STACK [and many more](https://community.cryptomator.org/t/webdav-urls-of-common-cloud-storage-services/75) @@ -209,7 +209,7 @@ Feel free to contribute, you can [submit issues here](https://github.com/thijsta ### Developer instructions 👩🏻‍💻👨🏻‍💻 System requirements: Have [Docker (Desktop or Engine)](https://www.docker.com/) installed on your system
-Techniques: [Python](https://www.python.org/), [Docker](https://www.docker.com/), [youtube-dl](https://youtube-dl.org/) and [WebDAV](http://www.webdav.org/) +Techniques: [Python](https://www.python.org/), [Docker](https://www.docker.com/), [YT-DLP](https://github.com/yt-dlp/yt-dlp) and [WebDAV](http://www.webdav.org/) 1. 🤠 Git clone the project with `git clone https://github.com/thijstakken/MusicService.git` 2. 🐛 [Pick a issue from the list or create a new issue and use that one](https://github.com/thijstakken/MusicService/issues) diff --git a/main.py b/main.py index 41a0a99..1c0f25f 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from re import L -import youtube_dl +from yt_dlp import YoutubeDL import shutil import requests import os @@ -28,6 +28,7 @@ def my_hook(d): # Configure YouTube DL options ydl_opts = { 'writethumbnail': True, + 'no_write_playlist_metafiles': True, # do not save playlist data, like playlist .png 'format': 'bestaudio[asr<=44100]/best[asr<=44100]/bestaudio', # using asr 44100 as max, this mitigates exotic compatibility issues with certain mediaplayers, and allow bestaudio as a fallback for direct mp3s 'postprocessors': [{ 'key': 'FFmpegExtractAudio', # use FFMPEG and only save audio @@ -42,7 +43,7 @@ def my_hook(d): 'simulate': False, # to dry test the YT-DL, if set to True, it will skip the downloading. Can be True/False 'cachedir': False, # turn off caching, this should mitigate 403 errors which are commonly seen when downloading from Youtube 'download_archive': './config/downloaded', # this will update the downloads file which serves as a database/archive for which songs have already been downloaded, so it don't downloads them again - 'nocheckcertificate': True, # mitigates YT-DL bug where it wrongly examins the server certificate, so therefore, ignore invalid certificates for now, to mitigate this bug + 'nocheckcertificates': True, # mitigates YT-DL bug where it wrongly examins the server certificate, so therefore, ignore invalid certificates for now, to mitigate this bug } # reads and saves playlist URL's in a list @@ -53,7 +54,7 @@ def getPlaylistURLs(): # downloads the playlists with the specified options in ydl_opts def downloadPlaylists(ydl_opts, lines): - with youtube_dl.YoutubeDL(ydl_opts) as ydl: + with YoutubeDL(ydl_opts) as ydl: ydl.download(lines) # creates directories in the cloud based on the local directory structure diff --git a/requirements.txt b/requirements.txt index ff0c3aa..4490e28 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -youtube_dl==2021.12.17 +#youtube_dl==2021.12.17 +yt-dlp==2023.7.6 python-dotenv #os requests