Closed
Description
Hi. I do want to make this software and some plugins available in FreeBSD ports tree and I started to port this software within some plugins. Unfortunately, mov-cli
isn't able to use already installed mpv
on my system. I don't understand python either. Thanks.
Describe the bug:
I ran mov-cli -s youtube not like us
and got those errors after i selected one video.
Mov-cli version: 4.4.12
Expected behaviour:
I would like to see mpv running the video that i've wanted because i spend time creating these ports on FreeBSD.
% pkg info -a | grep -E 'mov|pytube|devgoldy'
py311-devgoldyutils-3.0.0 Goldy's small python utils library
py311-mov-cli-4.4.12 Watch everything from your terminal
py311-mov-cli-test-1.1.7 mov-cli v4 plugin that let's you test mov-cli's capabilities
py311-mov-cli-youtube-1.3.4 mov-cli v4 plugin for watching youtube
py311-pytubefix-6.16.3 Library for downloading YouTube Videos
Steps to reproduce:
- Set youtube plugin in config
[mov-cli.plugins] # E.g: namespace = "package-name"
test = "mov-cli-test"
youtube = "mov-cli-youtube"
- run
mov-cli -s youtube not like us
Logs:
without debug parameter:
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Using '�[36myoutube.DEFAULT�[0m' scraper...
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Searching for '�[38;5;214mnot like us�[0m'...
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Scraping '�[38;5;51mKendrick Lamar - Not Like Us ~ Kendrick Lamar�[0m'...
�[33;20m[WARNING]�[0m (�[1;37;40mmov_cli�[0m) - �[92m[YTDlpScraper�[92m]�[0m Couldn't find the right audio for your currently selected language so audio localisation will be disabled and the first audio from the YouTube video will be selected.
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Playing '�[36mKendrick Lamar - Not Like Us ~ Kendrick Lamar�[0m' with �[38;5;200mMPV�[0m...
Good Night, �[38;5;214myusuf�[0m.
It's �[36m10:14 PM �[0mon a �[38;5;200mmagnificent �[38;5;139mSunday! �[0m
Traceback (most recent call last):
File "/usr/local/bin/mov-cli", line 8, in <module>
sys.exit(app())
^^^^^
File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/__main__.py", line 162, in app
uwu_app()
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 338, in __call__
raise e
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 321, in __call__
return get_command(self)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/typer/core.py", line 665, in main
return _main(
^^^^^^
File "/usr/local/lib/python3.11/site-packages/typer/core.py", line 197, in _main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 703, in wrapper
return callback(**use_params)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/__main__.py", line 158, in mov_cli
play(media, metadata, chosen_scraper, chosen_episode, config)
File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/play.py", line 58, in play
mov_cli_logger.debug(f"Called player with these args -> '{hide_ip(' '.join(popen.args), config.hide_ip)}'")
^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'args'
debug parameter output:
�[38;5;139m[DEBUG]�[0m (�[1;37;40mmov_cli�[0m) - Config -> {'version': 1, 'debug': True, 'player': 'mpv', 'quality': 'auto', 'skip_update_checker': False, 'auto_try_next_scraper': True, 'hide_ip': True, 'ui': {'preview': True, 'watch_options': True, 'display_quality': False}, 'plugins': {'test': 'mov-cli-test', 'youtube': 'mov-cli-youtube'}, 'scrapers': {'test': 'test.DEFAULT', 'default': 'youtube'}, 'http': {'timeout': 15}}
�[38;5;139m[DEBUG]�[0m (�[1;37;40mmov_cli�[0m) - Scraper args picked up on --> []
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Using '�[36myoutube.DEFAULT�[0m' scraper...
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Searching for '�[38;5;214mnot like us�[0m'...
[youtube:search] Extracting URL: ytsearch70:not like us
Good Night, �[38;5;214myusuf�[0m.
It's �[36m10:37 PM �[0mon a �[38;5;200mbeautiful �[38;5;139mSunday! �[0m
[download] Downloading playlist: not like us
[youtube:search] query "not like us": Downloading web client config
[youtube:search] query "not like us" page 1: Downloading API JSON
[youtube:search] query "not like us" page 2: Downloading API JSON
[youtube:search] query "not like us" page 3: Downloading API JSON
[youtube:search] query "not like us" page 4: Downloading API JSON
[youtube:search] Playlist not like us: Downloading 70 items of 70
[download] Downloading item 1 of 70
[download] Downloading item 2 of 70
[download] Downloading item 3 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 5 of 70
[download] Downloading item 6 of 70
[download] Downloading item 7 of 70
[download] Downloading item 8 of 70
[download] Downloading item 9 of 70
[download] Downloading item 10 of 70
[download] Downloading item 11 of 70
[download] Downloading item 12 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 14 of 70
[download] Downloading item 15 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 18 of 70
[download] Downloading item 19 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 23 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 25 of 70
[download] Downloading item 26 of 70
[download] Downloading item 27 of 70
[download] Downloading item 28 of 70
[download] Downloading item 29 of 70
[download] Downloading item 30 of 70
[download] Downloading item 31 of 70
[download] Downloading item 32 of 70
[download] Downloading item 33 of 70
[download] Downloading item 34 of 70
[download] Downloading item 35 of 70
[download] Downloading item 36 of 70
[download] Downloading item 37 of 70
[download] Downloading item 38 of 70
[download] Downloading item 39 of 70
[download] Downloading item 40 of 70
[download] Downloading item 41 of 70
[download] Downloading item 42 of 70
[download] Downloading item 43 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 50 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 54 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 56 of 70
[download] Downloading item 57 of 70
[download] Downloading item 58 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 60 of 70
[download] Downloading item 61 of 70
[download] Video is a YouTube short. Pass '--shorts' to the scraper to scrape for them.
[download] Downloading item 63 of 70
[download] Downloading item 64 of 70
[download] Downloading item 65 of 70
[download] Downloading item 66 of 70
[download] Downloading item 67 of 70
[download] Downloading item 68 of 70
[download] Downloading item 69 of 70
[download] Downloading item 70 of 70
[download] Finished downloading playlist: not like us
�[38;5;139m[DEBUG]�[0m (�[1;37;40mmov_cli�[0m) - �[92m[�[36mCache�[0m�[92m]�[0m Clearing all cache in file or section...
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Scraping '�[38;5;51mKendrick Lamar - Not Like Us ~ Kendrick Lamar�[0m'...
[youtube] Extracting URL: https://www.youtube.com/watch?v=H58vbez_m4E
[youtube] H58vbez_m4E: Downloading webpage
[youtube] H58vbez_m4E: Downloading ios player API JSON
[youtube] H58vbez_m4E: Downloading web creator player API JSON
[youtube] H58vbez_m4E: Downloading m3u8 information
�[33;20m[WARNING]�[0m (�[1;37;40mmov_cli�[0m) - �[92m[YTDlpScraper�[92m]�[0m Couldn't find the right audio for your currently selected language so audio localisation will be disabled and the first audio from the YouTube video will be selected.
�[38;5;139m[DEBUG]�[0m (�[1;37;40mmov_cli�[0m) - �[92m[�[36mCache�[0m�[92m]�[0m Setting 'https://www.youtube.com/watch?v=H58vbez_m4E' cache...
�[38;5;51m[INFO]�[0m (�[1;37;40mmov_cli�[0m) - Playing '�[36mKendrick Lamar - Not Like Us ~ Kendrick Lamar�[0m' with �[38;5;200mMPV�[0m...
Traceback (most recent call last):
File "/usr/local/bin/mov-cli", line 8, in <module>
sys.exit(app())
^^^^^
File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/__main__.py", line 162, in app
uwu_app()
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 338, in __call__
raise e
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 321, in __call__
return get_command(self)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/typer/core.py", line 665, in main
return _main(
^^^^^^
File "/usr/local/lib/python3.11/site-packages/typer/core.py", line 197, in _main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 703, in wrapper
return callback(**use_params)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/__main__.py", line 158, in mov_cli
play(media, metadata, chosen_scraper, chosen_episode, config)
File "/usr/local/lib/python3.11/site-packages/mov_cli/cli/play.py", line 58, in play
mov_cli_logger.debug(f"Called player with these args -> '{hide_ip(' '.join(popen.args), config.hide_ip)}'")
^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'args'
Platform:
- OS: FreeBSD
- Version: 14.1-P5
Checklist
- [ X ] I have added logs.
- [ X ] I have added my platform.
- [ X ] I have added my version number.
- [ X ] I am sure that this issue is not related to a plugin.
Additional info
FreeBSD platform was not available in the code and I added FreeBSD platform myself, maybe this problem caused by my patches. Here are patches applied to mov-cli
.
==> ../../../../files/patch-mov__cli_utils_paths.py <==
--- mov_cli/utils/paths.py.orig 2024-09-22 18:37:43 UTC
+++ mov_cli/utils/paths.py
@@ -25,7 +25,7 @@ def get_appdata_directory(platform: SUPPORTED_PLATFORM
user_profile = Path.home()
appdata_dir = user_profile.joinpath("Library", "Application Support")
- elif platform == "Linux" or platform == "Android" or platform == "iOS":
+ elif platform == "Linux" or platform == "FreeBSD" or platform == "Android" or platform == "iOS":
user_profile = Path(os.getenv("HOME"))
appdata_dir = user_profile.joinpath(".config")
@@ -49,7 +49,7 @@ def get_temp_directory(platform: SUPPORTED_PLATFORMS)
elif platform == "Darwin": # NOTE: Path maybe incorrect
temp_directory = Path(os.getenv("TMPDIR"))
- elif platform == "Linux" or platform == "iOS":
+ elif platform == "Linux" or platform == "FreeBSD" or platform == "iOS":
linux_temp_dir = os.getenv("TMPDIR") # Respect the TMPDIR environment variable on Linux: https://unix.stackexchange.com/a/362107
if linux_temp_dir is None:
@@ -78,7 +78,7 @@ def get_cache_directory(platform: SUPPORTED_PLATFORMS)
user_profile = Path.home()
cache_directory = user_profile.joinpath("Library", "Caches")
- elif platform == "Linux" or platform == "Android" or platform == "iOS":
+ elif platform == "Linux" or platform == "FreeBSD" or platform == "Android" or platform == "iOS":
user_profile = Path(os.getenv("HOME"))
cache_directory = user_profile.joinpath(".cache")
@@ -87,4 +87,4 @@ def get_cache_directory(platform: SUPPORTED_PLATFORMS)
cache_directory = cache_directory.joinpath("mov-cli")
cache_directory.mkdir(exist_ok = True)
- return cache_directory
\ No newline at end of file
+ return cache_directory
==> ../../../../files/patch-mov__cli_utils_platform.py <==
--- mov_cli/utils/platform.py.orig 2024-09-22 18:38:20 UTC
+++ mov_cli/utils/platform.py
@@ -4,7 +4,7 @@ if TYPE_CHECKING:
if TYPE_CHECKING:
from typing import Literal
- SUPPORTED_PLATFORMS = Literal["Windows", "Linux", "Android", "Darwin", "iOS"]
+ SUPPORTED_PLATFORMS = Literal["Windows", "Linux", "FreeBSD", "Android", "Darwin", "iOS"]
import sys
import platform
@@ -16,7 +16,7 @@ def what_platform() -> SUPPORTED_PLATFORMS:
"""
Returns what platform/OS this device is running on.
- E.g. Windows, Linux, Android, Darwin, iOS
+ E.g. Windows, Linux, FreeBSD, Android, Darwin, iOS
"""
os = platform.system()
@@ -47,4 +47,4 @@ def what_distro() -> str | None:
return RELEASE_DATA["ID"]
- return None
\ No newline at end of file
+ return None