commit:     5e3294f66dc56055316c8a6c6b6e79e61157f066
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 14 12:33:28 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Tue Dec 14 13:29:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e3294f6

media-video/vidify: youtube-dl --> yt-dlp

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 media-video/vidify/files/vidify-2.2.6-yt-dlp.patch | 122 +++++++++++++++++++++
 ...{vidify-2.2.6.ebuild => vidify-2.2.6-r1.ebuild} |   9 +-
 2 files changed, 128 insertions(+), 3 deletions(-)

diff --git a/media-video/vidify/files/vidify-2.2.6-yt-dlp.patch 
b/media-video/vidify/files/vidify-2.2.6-yt-dlp.patch
new file mode 100644
index 000000000000..6ce0f836d5fd
--- /dev/null
+++ b/media-video/vidify/files/vidify-2.2.6-yt-dlp.patch
@@ -0,0 +1,122 @@
+diff --git a/README.md b/README.md
+index c4ea164..51e65e6 100644
+--- a/README.md
++++ b/README.md
+@@ -79,7 +79,7 @@ Audiosync is only available on Linux for now. It's strongly 
recommended to use M
+ * FFTW: `libfftw3` on Debian-based distros.
+ * ffmpeg: `ffmpeg` on most repositories. It must be available on your path.
+ * pulseaudio: `pulseaudio`, pre-installed on most repos.
+-* youtube-dl: this is installed by default with Vidify, but make sure it's 
available on your path.
++* yt-dlp: this is installed by default with Vidify, but make sure it's 
available on your path.
+ 
+ It's also available as 
[`vidify-audiosync`](https://aur.archlinux.org/packages/vidify-audiosync) on 
the AUR, and it comes pre-installed in the binaries.
+ 
+diff --git a/dev/build_requires.txt b/dev/build_requires.txt
+index ed682fd..a8bbc30 100644
+--- a/dev/build_requires.txt
++++ b/dev/build_requires.txt
+@@ -14,5 +14,5 @@ QtPy
+ SwSpotify>=1.1.1; platform_system == "Windows" or platform_system == "Darwin"
+ tekore < 2.0
+ vidify-audiosync == 0.2.*
+-youtube-dl
++yt-dlp
+ zeroconf
+diff --git a/dev/snapcraft.yaml b/dev/snapcraft.yaml
+index a5446de..00d2aae 100644
+--- a/dev/snapcraft.yaml
++++ b/dev/snapcraft.yaml
+@@ -22,7 +22,7 @@ parts:
+       - python3-pyqt5
+       - python3-appdirs
+       - python3-pydbus
+-      - youtube-dl
++      - yt-dlp
+       # Mpv is used by default because it's lighter and works better
+       # with the audiosync feature.
+       - libmpv-dev
+diff --git a/setup.py b/setup.py
+index 3fdb656..9b1c093 100644
+--- a/setup.py
++++ b/setup.py
+@@ -19,7 +19,7 @@ install_deps = [
+     # Base package
+     'QtPy',
+     'lyricwikia',
+-    'youtube-dl',
++    'yt-dlp',
+     'appdirs',
+     'qdarkstyle',
+     'dataclasses; python_version<"3.7"',
+diff --git a/vidify/player/mpv.py b/vidify/player/mpv.py
+index 4b92571..68bd1a5 100644
+--- a/vidify/player/mpv.py
++++ b/vidify/player/mpv.py
+@@ -30,7 +30,7 @@ locale.setlocale(locale.LC_NUMERIC, 'C')
+ 
+ class MpvPlayer(PlayerBase):
+     # The audio is always muted, which is needed because not all the
+-    # youtube-dl videos are silent. The keep-open flag stops mpv from closing
++    # yt-dlp videos are silent. The keep-open flag stops mpv from closing
+     # after the video is over.
+     DEFAULT_FLAGS = ['mute']
+     DEFAULT_ARGS = {
+diff --git a/vidify/player/vlc.py b/vidify/player/vlc.py
+index 6a0bec7..a7c9ec0 100644
+--- a/vidify/player/vlc.py
++++ b/vidify/player/vlc.py
+@@ -31,7 +31,7 @@ class VLCPlayer(PlayerBase):
+         else:
+             vlc_args += " --quiet"
+         # The audio is always muted, which is needed because not all the
+-        # youtube-dl videos are silent.
++        # yt-dlp videos are silent.
+         # Needed for the audiosync feature: set the Group of Pictures size to
+         # one, so that seeking is more precise.
+         vlc_args += " --no-audio --sout-x264-min-keyint 1"
+diff --git a/vidify/youtube.py b/vidify/youtube.py
+index 1b23bfb..b959f34 100644
+--- a/vidify/youtube.py
++++ b/vidify/youtube.py
+@@ -1,5 +1,5 @@
+ """
+-This module uses youtube-dl to obtain the actual URL of a YouTube link.
++This module uses yt-dlp to obtain the actual URL of a YouTube link.
+ That way, the video can be played directly with a video player like VLC
+ or mpv.
+ """
+@@ -7,7 +7,7 @@ or mpv.
+ import logging
+ from typing import Optional
+ 
+-from youtube_dl import YoutubeDL
++from yt_dlp import YoutubeDL
+ from qtpy.QtCore import QObject, Signal
+ 
+ 
+@@ -63,7 +63,7 @@ class YouTubeDLWorker(QObject):
+ 
+     def get_url(self) -> None:
+         """
+-        Getting the youtube direct link with youtube-dl, intended to be used
++        Getting the youtube direct link with yt-dlp, intended to be used
+         with a QThread. It's guaranteed that either a success signal or a
+         fail signal will be emitted.
+         """
+@@ -74,13 +74,13 @@ class YouTubeDLWorker(QObject):
+             except Exception as e:
+                 # Any kind of error has to be caught, so that it doesn't only
+                 # send the error signal when the download wasn't successful
+-                # (a DownloadError from youtube_dl).
+-                logging.info("YouTube-dl wasn't able to obtain the video: %s",
++                # (a DownloadError from yt_dlp).
++                logging.info("yt-dlp wasn't able to obtain the video: %s",
+                              str(e))
+                 self.fail.emit()
+             else:
+                 if len(data['entries']) == 0:
+-                    logging.info("YouTube-dl returned no entries")
++                    logging.info("yt-dlp returned no entries")
+                     self.fail.emit()
+                 else:
+                     self.success.emit(data)

diff --git a/media-video/vidify/vidify-2.2.6.ebuild 
b/media-video/vidify/vidify-2.2.6-r1.ebuild
similarity index 91%
rename from media-video/vidify/vidify-2.2.6.ebuild
rename to media-video/vidify/vidify-2.2.6-r1.ebuild
index 94b2caead30c..ae5d74063584 100644
--- a/media-video/vidify/vidify-2.2.6.ebuild
+++ b/media-video/vidify/vidify-2.2.6-r1.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-PYTHON_COMPAT=( python3_{7..10} )
+PYTHON_COMPAT=( python3_{8..10} )
 
 inherit xdg distutils-r1 optfeature virtualx
 
@@ -23,7 +23,7 @@ RDEPEND="
        dev-python/appdirs[${PYTHON_USEDEP}]
        dev-python/QtPy[gui,webengine,${PYTHON_USEDEP}]
        net-misc/lyricwikia[${PYTHON_USEDEP}]
-       net-misc/youtube-dl[${PYTHON_USEDEP}]
+       net-misc/yt-dlp[${PYTHON_USEDEP}]
        dbus? ( dev-python/pydbus[${PYTHON_USEDEP}] )
        !dbus? ( dev-python/tekore[${PYTHON_USEDEP}] )
        mpv? ( dev-python/python-mpv[${PYTHON_USEDEP}] )
@@ -31,6 +31,9 @@ RDEPEND="
        zeroconf? ( dev-python/zeroconf[${PYTHON_USEDEP}] )
 "
 
+# use yt-dlp instead of youtube-dl, otherwise download is too slow for playback
+PATCHES=( "${FILESDIR}/${P}-yt-dlp.patch" )
+
 distutils_enable_tests unittest
 
 python_prepare_all() {

Reply via email to