Deprecate mps-youtube and python-pafy

**Summary**

mps-youtube got replaced by yewtube and python-pafy is no longer a separate project/package

Signed-off-by: Thomas Staudinger <Staudi.Kaos@gmail.com>
This commit is contained in:
Thomas Staudinger 2024-11-29 12:03:32 +01:00 committed by David Harder
parent d9c11771cc
commit 9c80f303a5
5 changed files with 6 additions and 228 deletions

View file

@ -1,147 +0,0 @@
From a28b3c5f1451802a76e49af822ad4f552416859d Mon Sep 17 00:00:00 2001
From: Thomas Staudinger <Staudi.Kaos@gmail.com>
Date: Tue, 9 Nov 2021 19:15:44 +0100
Subject: [PATCH] Replace youtube-dl with yt-dlp
---
README.rst | 2 +-
pafy/backend_internal.py | 2 +-
pafy/{backend_youtube_dl.py => backend_yt_dlp.py} | 8 ++++----
pafy/jsinterp.py | 4 ++--
pafy/pafy.py | 10 +++++-----
setup.py | 2 +-
6 files changed, 14 insertions(+), 14 deletions(-)
rename pafy/{backend_youtube_dl.py => backend_yt_dlp.py} (97%)
diff --git a/README.rst b/README.rst
index 452fd8b..8b1377d 100644
--- a/README.rst
+++ b/README.rst
@@ -27,7 +27,7 @@ Features
- Download audio only (no video) in ogg or m4a format
- Retreive playlists and playlist metadata
- Works with Python 2.6+ and 3.3+
-- Optionally depends on youtube-dl (recommended; more stable)
+- Optionally depends on yt-dlp (recommended; more stable)
Documentation
diff --git a/pafy/backend_internal.py b/pafy/backend_internal.py
index 9ccdc28..efc61a4 100644
--- a/pafy/backend_internal.py
+++ b/pafy/backend_internal.py
@@ -266,7 +266,7 @@ def get_video_info(video_id, callback, newurl=None):
""" Return info for video_id. Returns dict. """
# TODO: see if there is a way to avoid retrieving the embed page
# just for this, or to use it for more. This was coppied from
- # youtube-dl.
+ # yt-dlp.
embed_webpage = fetch_decode(g.urls['embed'])
sts = re.search(r'sts"\s*:\s*(\d+)', embed_webpage).group(1)
diff --git a/pafy/backend_youtube_dl.py b/pafy/backend_yt_dlp.py
similarity index 97%
rename from pafy/backend_youtube_dl.py
rename to pafy/backend_yt_dlp.py
index 4b38f12..c5f4ace 100644
--- a/pafy/backend_youtube_dl.py
+++ b/pafy/backend_yt_dlp.py
@@ -10,7 +10,7 @@ if sys.version_info[:2] >= (3, 0):
else:
uni = unicode
-import youtube_dl
+import yt_dlp
from . import g
from .backend_shared import BasePafy, BaseStream, remux, get_status_string, get_size_done
@@ -35,11 +35,11 @@ class YtdlPafy(BasePafy):
if self._have_basic:
return
- with youtube_dl.YoutubeDL(self._ydl_opts) as ydl:
+ with yt_dlp.YoutubeDL(self._ydl_opts) as ydl:
try:
self._ydl_info = ydl.extract_info(self.videoid, download=False)
# Turn into an IOError since that is what pafy previously raised
- except youtube_dl.utils.DownloadError as e:
+ except yt_dlp.utils.DownloadError as e:
raise IOError(str(e).replace('YouTube said', 'Youtube says'))
if self.callback:
@@ -132,7 +132,7 @@ class YtdlStream(BaseStream):
def download(self, filepath="", quiet=False, progress="Bytes",
callback=None, meta=False, remux_audio=False):
- downloader = youtube_dl.downloader.http.HttpFD(ydl(),
+ downloader = yt_dlp.downloader.http.HttpFD(ydl(),
{'http_chunk_size': 10485760})
progress_available = ["KB", "MB", "GB"]
diff --git a/pafy/jsinterp.py b/pafy/jsinterp.py
index 3b0b889..b83339b 100644
--- a/pafy/jsinterp.py
+++ b/pafy/jsinterp.py
@@ -1,4 +1,4 @@
-# Copied from youtube_dl
+# Copied from yt_dlp
from __future__ import unicode_literals
@@ -14,7 +14,7 @@ class ExtractorError(Exception):
def __init__(self, msg, tb=None, expected=False, cause=None, video_id=None):
""" tb, if given, is the original traceback (so that it can be printed out).
- If expected is set, this is a normal error message and most likely not a bug in youtube-dl.
+ If expected is set, this is a normal error message and most likely not a bug in yt-dlp.
"""
if video_id is not None:
diff --git a/pafy/pafy.py b/pafy/pafy.py
index 62bde9a..08b7f75 100644
--- a/pafy/pafy.py
+++ b/pafy/pafy.py
@@ -45,14 +45,14 @@ Pafy = None
backend = "internal"
if os.environ.get("PAFY_BACKEND") != "internal":
try:
- import youtube_dl
- backend = "youtube-dl"
+ import yt_dlp
+ backend = "yt-dlp"
except ImportError:
raise ImportError(
- "pafy: youtube-dl not found; you can use the internal backend by "
+ "pafy: yt-dlp not found; you can use the internal backend by "
"setting the environmental variable PAFY_BACKEND to \"internal\". "
"It is not enabled by default because it is not as well maintained "
- "as the youtube-dl backend.")
+ "as the yt-dlp backend.")
if os.environ.get("pafydebug") == "1":
logging.basicConfig(level=logging.DEBUG)
@@ -119,7 +119,7 @@ def new(url, basic=True, gdata=False, size=False,
if backend == "internal":
from .backend_internal import InternPafy as Pafy
else:
- from .backend_youtube_dl import YtdlPafy as Pafy
+ from .backend_yt_dlp import YtdlPafy as Pafy
return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
diff --git a/setup.py b/setup.py
index 99a9a0d..9f820ac 100755
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ setup(
url="http://np1.github.io/pafy/",
download_url="https://github.com/np1/pafy/tarball/master",
extras_require={
- 'youtube-dl-backend': ["youtube-dl"],
+ 'yt-dlp-backend': ["yt-dlp"],
},
package_data={"": ["LICENSE", "README.rst", "CHANGELOG", "AUTHORS"]},
include_package_data=True,
--
2.33.1

View file

@ -1,21 +0,0 @@
name : python-pafy
version : 0.5.5
release : 9
source :
- https://github.com/mps-youtube/pafy/releases/download/v0.5.5/pafy-0.5.5.tar.gz : 364f1d1312c89582d97dc7225cf6858cde27cb11dfd64a9c2bab1a2f32133b1e
homepage : https://github.com/mps-youtube/pafy
license : LGPL-3.0-or-later
component : programming.python
summary : Python API for YouTube
description: |
Python library to download YouTube content and retrieve metadata.
builddeps :
- yt-dlp
rundeps :
- yt-dlp
setup : |
%patch -p1 -i $pkgfiles/0001-Replace-youtube-dl-with-yt-dlp.patch
build : |
%python3_setup
install : |
%python3_install

View file

@ -1,60 +0,0 @@
<PISI>
<Source>
<Name>python-pafy</Name>
<Homepage>https://github.com/mps-youtube/pafy</Homepage>
<Packager>
<Name>Joey Riches</Name>
<Email>josephriches@gmail.com</Email>
</Packager>
<License>LGPL-3.0-or-later</License>
<PartOf>programming.python</PartOf>
<Summary xml:lang="en">Python API for YouTube</Summary>
<Description xml:lang="en">Python library to download YouTube content and retrieve metadata.
</Description>
<Archive type="binary" sha1sum="79eb0752a961b8e0d15c77d298c97498fbc89c5a">https://sources.getsol.us/README.Solus</Archive>
</Source>
<Package>
<Name>python-pafy</Name>
<Summary xml:lang="en">Python API for YouTube</Summary>
<Description xml:lang="en">Python library to download YouTube content and retrieve metadata.
</Description>
<PartOf>programming.python</PartOf>
<Files>
<Path fileType="executable">/usr/bin/ytdl</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy-0.5.5-py3.11.egg-info/PKG-INFO</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy-0.5.5-py3.11.egg-info/SOURCES.txt</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy-0.5.5-py3.11.egg-info/dependency_links.txt</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy-0.5.5-py3.11.egg-info/requires.txt</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy-0.5.5-py3.11.egg-info/top_level.txt</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__init__.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/__init__.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/backend_internal.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/backend_shared.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/backend_yt_dlp.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/channel.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/g.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/jsinterp.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/pafy.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/playlist.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/__pycache__/util.cpython-311.pyc</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/backend_internal.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/backend_shared.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/backend_yt_dlp.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/channel.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/g.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/jsinterp.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/pafy.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/playlist.py</Path>
<Path fileType="library">/usr/lib/python3.11/site-packages/pafy/util.py</Path>
</Files>
</Package>
<History>
<Update release="9">
<Date>2024-02-14</Date>
<Version>0.5.5</Version>
<Comment>Packaging update</Comment>
<Name>Joey Riches</Name>
<Email>josephriches@gmail.com</Email>
</Update>
</History>
</PISI>

View file

@ -2765,5 +2765,7 @@
<Package>llvm-32bit</Package>
<Package>minetest</Package>
<Package>minetest-dbginfo</Package>
<Package>mps-youtube</Package>
<Package>python-pafy</Package>
</Obsoletes>
</PISI>

View file

@ -3701,6 +3701,10 @@
<!-- Renamed as luanti -->
<Package>minetest</Package>
<Package>minetest-dbginfo</Package>
<!-- Replaced by yewtube -->
<Package>mps-youtube</Package>
<Package>python-pafy</Package>
</Obsoletes>
</PISI>