git: 7a64d4ddf15f - main - www/yt-dlp: Update 2022.05.18 -> 2022.06.22.1

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 22 Jun 2022 01:38:38 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7a64d4ddf15f926ca01d576f082a550d691dc12f

commit 7a64d4ddf15f926ca01d576f082a550d691dc12f
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-06-22 01:31:46 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-06-22 01:38:36 +0000

    www/yt-dlp: Update 2022.05.18 -> 2022.06.22.1
---
 www/yt-dlp/Makefile                            |  6 +--
 www/yt-dlp/distinfo                            |  6 +--
 www/yt-dlp/files/patch-Makefile                | 59 ++++++--------------------
 www/yt-dlp/files/patch-yt__dlp_____init____.py | 43 ++++++++++++-------
 www/yt-dlp/files/patch-yt__dlp_cookies.py      | 11 -----
 www/yt-dlp/files/patch-yt__dlp_options.py      | 10 ++---
 6 files changed, 51 insertions(+), 84 deletions(-)

diff --git a/www/yt-dlp/Makefile b/www/yt-dlp/Makefile
index 6593ed147ac6..39c1d711bfd1 100644
--- a/www/yt-dlp/Makefile
+++ b/www/yt-dlp/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	yt-dlp
-DISTVERSION=	2022.05.18
+DISTVERSION=	2022.06.22.1
 CATEGORIES=	www
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -18,10 +18,10 @@ BUILD_DEPENDS=	${PY_DEPENDS}
 RUN_DEPENDS=	${PY_DEPENDS}
 
 USES=		gmake python:3.7+ shebangfix
-SHEBANG_GLOB=	devscripts/*.py
-
 USE_GITHUB=	yes
 
+SHEBANG_GLOB=	devscripts/*.py
+
 MAKE_ARGS=	PYTHON=${PYTHON_CMD}
 
 NO_ARCH=	yes
diff --git a/www/yt-dlp/distinfo b/www/yt-dlp/distinfo
index 49b3c3de5ee8..4c66506c30fa 100644
--- a/www/yt-dlp/distinfo
+++ b/www/yt-dlp/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1652847318
-SHA256 (yt-dlp-yt-dlp-2022.05.18_GH0.tar.gz) = 6bb20a8afd5d4449fbb1bc7032854eb285defc1e46337df0942852e2d26d18f5
-SIZE (yt-dlp-yt-dlp-2022.05.18_GH0.tar.gz) = 2034054
+TIMESTAMP = 1655860813
+SHA256 (yt-dlp-yt-dlp-2022.06.22.1_GH0.tar.gz) = ba45c4136385e56054280ddc5f851857d160c388414784f9ba4a664755fce80f
+SIZE (yt-dlp-yt-dlp-2022.06.22.1_GH0.tar.gz) = 2065673
diff --git a/www/yt-dlp/files/patch-Makefile b/www/yt-dlp/files/patch-Makefile
index 6040544260bd..0c0f1d8d099a 100644
--- a/www/yt-dlp/files/patch-Makefile
+++ b/www/yt-dlp/files/patch-Makefile
@@ -1,35 +1,20 @@
---- Makefile.orig	2022-05-18 03:37:32 UTC
+--- Makefile.orig	2022-06-22 00:50:42 UTC
 +++ Makefile
-@@ -1,15 +1,15 @@
+@@ -1,4 +1,4 @@
 -all: lazy-extractors yt-dlp doc pypi-files
--clean: clean-test clean-dist
-+#all: lazy-extractors yt-dlp doc pypi-files
 +all: lazy-extractors yt-dlp
+ clean: clean-test clean-dist
  clean-all: clean clean-cache
  completions: completion-bash completion-fish completion-zsh
--doc: README.md CONTRIBUTING.md issuetemplates supportedsites
-+#doc: README.md CONTRIBUTING.md issuetemplates supportedsites
- ot: offlinetest
- tar: yt-dlp.tar.gz
- 
- # Keep this list in sync with MANIFEST.in
- # intended use: when building a source distribution,
- # make pypi-files && python setup.py sdist
--pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites completions yt-dlp.1 devscripts/* test/*
-+#pypi-files: AUTHORS Changelog.md LICENSE README.md README.txt supportedsites completions yt-dlp.1 devscripts/* test/*
- 
- .PHONY: all clean install test tar pypi-files completions ot offlinetest codetest supportedsites
- 
-@@ -39,16 +39,17 @@ SHAREDIR ?= $(PREFIX)/share
+@@ -40,16 +40,16 @@ SHAREDIR ?= $(PREFIX)/share
  PYTHON ?= /usr/bin/env python3
  
  # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
 -SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi)
-+#SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi)
 +SYSCONFDIR = $(PREFIX)/etc
  
  # set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2
- MARKDOWN = $(shell if [ "$(pandoc -v | head -n1 | cut -d" " -f2 | head -c1)" = "2" ]; then echo markdown-smart; else echo markdown; fi)
+ MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi)
  
 -install: lazy-extractors yt-dlp yt-dlp.1 completions
 +install: lazy-extractors yt-dlp completions
@@ -41,27 +26,26 @@
  	mkdir -p $(DESTDIR)$(SHAREDIR)/bash-completion/completions
  	install -m644 completions/bash/yt-dlp $(DESTDIR)$(SHAREDIR)/bash-completion/completions/yt-dlp
  	mkdir -p $(DESTDIR)$(SHAREDIR)/zsh/site-functions
-@@ -84,37 +85,38 @@ yt-dlp: yt_dlp/*.py yt_dlp/*/*.py
+@@ -85,26 +85,26 @@ yt-dlp: yt_dlp/*.py yt_dlp/*/*.py
  	done
  	touch -t 200001010101 zip/yt_dlp/*.py zip/yt_dlp/*/*.py zip/yt_dlp/*/*/*.py
  	mv zip/yt_dlp/__main__.py zip/
 -	cd zip ; zip -q ../yt-dlp yt_dlp/*.py yt_dlp/*/*.py yt_dlp/*/*/*.py __main__.py
-+	#cd zip ; zip -q ../yt-dlp yt_dlp/*.py yt_dlp/*/*.py yt_dlp/*/*/*.py __main__.py
-+	cd zip ; bsdtar -a -cf ../yt-dlp.zip yt_dlp/*.py yt_dlp/*/*.py __main__.py
++	cd zip ; bsdtar -a -cf ../yt-dlp.zip yt_dlp/*.py yt_dlp/*/*.py yt_dlp/*/*/*.py __main__.py
  	rm -rf zip
  	echo '#!$(PYTHON)' > yt-dlp
  	cat yt-dlp.zip >> yt-dlp
  	rm yt-dlp.zip
  	chmod a+x yt-dlp
  
--README.md: yt_dlp/*.py yt_dlp/*/*.py
--	COLUMNS=80 $(PYTHON) yt_dlp/__main__.py --help | $(PYTHON) devscripts/make_readme.py
-+#README.md: yt_dlp/*.py yt_dlp/*/*.py
-+#	COLUMNS=80 $(PYTHON) yt_dlp/__main__.py --help | $(PYTHON) devscripts/make_readme.py
+-README.md: yt_dlp/*.py yt_dlp/*/*.py devscripts/make_readme.py
+-	COLUMNS=80 $(PYTHON) yt_dlp/__main__.py --ignore-config --help | $(PYTHON) devscripts/make_readme.py
++#README.md: yt_dlp/*.py yt_dlp/*/*.py devscripts/make_readme.py
++#	COLUMNS=80 $(PYTHON) yt_dlp/__main__.py --ignore-config --help | $(PYTHON) devscripts/make_readme.py
  
--CONTRIBUTING.md: README.md
+-CONTRIBUTING.md: README.md devscripts/make_contributing.py
 -	$(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md
-+#CONTRIBUTING.md: README.md
++#CONTRIBUTING.md: README.md devscripts/make_contributing.py
 +#	$(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md
  
 -issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.yml .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.yml .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.yml .github/ISSUE_TEMPLATE_tmpl/4_bug_report.yml .github/ISSUE_TEMPLATE_tmpl/5_feature_request.yml yt_dlp/version.py
@@ -81,20 +65,3 @@
  
  supportedsites:
  	$(PYTHON) devscripts/make_supportedsites.py supportedsites.md
- 
--README.txt: README.md
--	pandoc -f $(MARKDOWN) -t plain README.md -o README.txt
-+#README.txt: README.md
-+#	pandoc -f $(MARKDOWN) -t plain README.md -o README.txt
- 
--yt-dlp.1: README.md
--	$(PYTHON) devscripts/prepare_manpage.py yt-dlp.1.temp.md
--	pandoc -s -f $(MARKDOWN) -t man yt-dlp.1.temp.md -o yt-dlp.1
--	rm -f yt-dlp.1.temp.md
-+#yt-dlp.1: README.md
-+#	$(PYTHON) devscripts/prepare_manpage.py yt-dlp.1.temp.md
-+#	pandoc -s -f $(MARKDOWN) -t man yt-dlp.1.temp.md -o yt-dlp.1
-+#	rm -f yt-dlp.1.temp.md
- 
- completions/bash/yt-dlp: yt_dlp/*.py yt_dlp/*/*.py devscripts/bash-completion.in
- 	mkdir -p completions/bash
diff --git a/www/yt-dlp/files/patch-yt__dlp_____init____.py b/www/yt-dlp/files/patch-yt__dlp_____init____.py
index 11e90c5f8d48..3e4437de00c6 100644
--- a/www/yt-dlp/files/patch-yt__dlp_____init____.py
+++ b/www/yt-dlp/files/patch-yt__dlp_____init____.py
@@ -1,21 +1,32 @@
---- yt_dlp/__init__.py.orig	2021-10-22 20:47:18 UTC
+--- yt_dlp/__init__.py.orig	2022-06-22 00:50:42 UTC
 +++ yt_dlp/__init__.py
-@@ -756,17 +756,9 @@ def _real_main(argv=None):
+@@ -879,20 +879,20 @@ def _real_main(argv=None):
+         return
+ 
+     with YoutubeDL(ydl_opts) as ydl:
+-        pre_process = opts.update_self or opts.rm_cachedir
++        pre_process = opts.rm_cachedir
+         actual_use = all_urls or opts.load_info_filename
+ 
          if opts.rm_cachedir:
              ydl.cache.remove()
  
--        # Update version
--        if opts.update_self:
--            # If updater returns True, exit. Required for windows
--            if run_update(ydl):
--                if actual_use:
--                    sys.exit('ERROR: The program must exit for the update to complete')
--                sys.exit()
--
-         # Maybe do nothing
-         if not actual_use:
--            if opts.update_self or opts.rm_cachedir:
-+            if opts.rm_cachedir:
-                 sys.exit()
+-        updater = Updater(ydl)
+-        if opts.update_self and updater.update() and actual_use:
+-            if updater.cmd:
+-                return updater.restart()
+-            # This code is reachable only for zip variant in py < 3.10
+-            # It makes sense to exit here, but the old behavior is to continue
+-            ydl.report_warning('Restart yt-dlp to use the updated version')
+-            # return 100, 'ERROR: The program must exit for the update to complete'
++        #updater = Updater(ydl)
++        #if opts.update_self and updater.update() and actual_use:
++        #    if updater.cmd:
++        #        return updater.restart()
++        #    # This code is reachable only for zip variant in py < 3.10
++        #    # It makes sense to exit here, but the old behavior is to continue
++        #    ydl.report_warning('Restart yt-dlp to use the updated version')
++        #    # return 100, 'ERROR: The program must exit for the update to complete'
  
-             ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv)
+         if not actual_use:
+             if pre_process:
diff --git a/www/yt-dlp/files/patch-yt__dlp_cookies.py b/www/yt-dlp/files/patch-yt__dlp_cookies.py
deleted file mode 100644
index e298f7b0c119..000000000000
--- a/www/yt-dlp/files/patch-yt__dlp_cookies.py
+++ /dev/null
@@ -1,11 +0,0 @@
---- yt_dlp/cookies.py.orig	2022-05-18 03:37:32 UTC
-+++ yt_dlp/cookies.py
-@@ -156,7 +156,7 @@ def _extract_firefox_cookies(profile, logger):
- 
- 
- def _firefox_browser_dir():
--    if sys.platform in ('linux', 'linux2'):
-+    if sys.platform in ('linux', 'linux2','freebsd13','freebsd14'):
-         return os.path.expanduser('~/.mozilla/firefox')
-     elif sys.platform == 'win32':
-         return os.path.expandvars(R'%APPDATA%\Mozilla\Firefox\Profiles')
diff --git a/www/yt-dlp/files/patch-yt__dlp_options.py b/www/yt-dlp/files/patch-yt__dlp_options.py
index 7adce2d76943..7f7fdfb82562 100644
--- a/www/yt-dlp/files/patch-yt__dlp_options.py
+++ b/www/yt-dlp/files/patch-yt__dlp_options.py
@@ -1,6 +1,6 @@
---- yt_dlp/options.py.orig	2021-10-22 20:47:18 UTC
+--- yt_dlp/options.py.orig	2022-06-22 01:17:57 UTC
 +++ yt_dlp/options.py
-@@ -203,10 +203,6 @@ def parseOpts(overrideArguments=None):
+@@ -313,10 +313,6 @@ def create_parser():
          action='version',
          help='Print program version and exit')
      general.add_option(
@@ -8,6 +8,6 @@
 -        action='store_true', dest='update_self',
 -        help='Update this program to latest version')
 -    general.add_option(
-         '-i', '--ignore-errors',
-         action='store_true', dest='ignoreerrors',
-         help='Ignore download and postprocessing errors. The download will be considered successfull even if the postprocessing fails')
+         '--no-update',
+         action='store_false', dest='update_self',
+         help='Do not update (default)')