mov-cli / mov-cli

Watch everything from your terminal.
https://mov-cli.github.io/
MIT License
411 stars 36 forks source link

[BUG] TypeError when trying to download via -d flag #282

Closed GreatTeacherOni closed 1 month ago

GreatTeacherOni commented 1 month ago

Describe the bug: I get an error after running following command in bash mov-cli -d -s films Metropolis. The error message is following: TypeError: expected str, bytes or os.PathLike object, not NoneType Expected behavior: The selected type of video should be downloaded into the current working directory.

Screenshots No screenshots. See terminal output.

Error:

Input: mov-cli -d -s films Metropolis --debug Output:

/home/user/.venv/py311/lib/python3.11/site-packages/mov_cli/cli/__main__.py:108 in mov_cli       │
│                                                                                                  │
│   105 │   │   │   dl = Download(config)                                                          │
│   106 │   │   │   mov_cli_logger.debug(f"Downloading from this url -> '{media.url}'")            │
│   107 │   │   │                                                                                  │
│ ❱ 108 │   │   │   popen = dl.download(media)                                                     │
│   109 │   │   │   popen.wait()                                                                   │
│   110 │   │                                                                                      │
│   111 │   │   else:                                                                              │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      auto_select = None                                                                      │ │
│ │           choice = Metadata(                                                                 │ │
│ │                    │   id=19,                                                                │ │
│ │                    │   title='Metropolis',                                                   │ │
│ │                    │   type=<MetadataType.MOVIE: 1>,                                         │ │
│ │                    │   year='1927',                                                          │ │
│ │                    │   extra_func=<function TheMovieDB.search.<locals>.<lambda> at           │ │
│ │                    0x7fd2a44c1440>                                                           │ │
│ │                    )                                                                         │ │
│ │   chosen_episode = EpisodeSelector(episode=1, season=1)                                      │ │
│ │   chosen_scraper = <mov_cli_films.vidsrcto.scraper.VidSrcToScraper object at 0x7fd2a44efa10> │ │
│ │           config = <mov_cli.config.Config object at 0x7fd2a4492bd0>                          │ │
│ │            debug = True                                                                      │ │
│ │               dl = <mov_cli.download.Download object at 0x7fd2a44ef610>                      │ │
│ │         download = True                                                                      │ │
│ │             edit = False                                                                     │ │
│ │          episode = None                                                                      │ │
│ │              fzf = None                                                                      │ │
│ │      http_client = <mov_cli.http_client.HTTPClient object at 0x7fd2a44eff90>                 │ │
│ │            media = <mov_cli.media.media.Single object at 0x7fd2a437a9d0>                     │ │
│ │           player = None                                                                      │ │
│ │            query = 'Metropolis'                                                              │ │
│ │      scrape_args = {}                                                                        │ │
│ │          scraper = 'films'                                                                   │ │
│ │ selected_scraper = (                                                                         │ │
│ │                    │   'films.DEFAULT',                                                      │ │
│ │                    │   <class 'mov_cli_films.vidsrcto.scraper.VidSrcToScraper'>              │ │
│ │                    )                                                                         │ │
│ │          version = False                                                                     │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /home/user/.venv/py311/lib/python3.11/site-packages/mov_cli/download.py:38 in download           │
│                                                                                                  │
│   35 │   │                                                                                       │
│   36 │   │   args.append(file)                                                                   │
│   37 │   │                                                                                       │
│ ❱ 38 │   │   return subprocess.Popen(args)                                                       │
│   39                                                                                             │
│                                                                                                  │
│ ╭──────────────────────────────── locals ─────────────────────────────────╮                      │
│ │      args = [                                                           │                      │
│ │             │   'ffmpeg',                                               │                      │
│ │             │   '-n',                                                   │                      │
│ │             │   '-headers',                                             │                      │
│ │             │   'Referer: https://e69975b881.nl/',                      │                      │
│ │             │   '-i',                                                   │                      │
│ │             │   None,                                                   │                      │
│ │             │   '-c',                                                   │                      │
│ │             │   'copy',                                                 │                      │
│ │             │   '/home/user/Videos/Metropolis (1927).mp4' │                      │
│ │             ]                                                           │                      │
│ │      file = '/home/user/Videos/Metropolis (1927).mp4'     │                      │
│ │     media = <mov_cli.media.media.Single object at 0x7fd2a437a9d0>       │                      │
│ │      self = <mov_cli.download.Download object at 0x7fd2a44ef610>        │                      │
│ │ subtitles = None                                                        │                      │
│ │     title = 'Metropolis (1927)'                                         │                      │
│ ╰─────────────────────────────────────────────────────────────────────────╯                      │
│                                                                                                  │
│ /run/current-system/sw/lib/python3.11/subprocess.py:1026 in __init__                             │
│                                                                                                  │
│   1023 │   │   │   │   │   self.stderr = io.TextIOWrapper(self.stderr,                           │
│   1024 │   │   │   │   │   │   │   encoding=encoding, errors=errors)                             │
│   1025 │   │   │                                                                                 │
│ ❱ 1026 │   │   │   self._execute_child(args, executable, preexec_fn, close_fds,                  │
│   1027 │   │   │   │   │   │   │   │   pass_fds, cwd, env,                                       │
│   1028 │   │   │   │   │   │   │   │   startupinfo, creationflags, shell,                        │
│   1029 │   │   │   │   │   │   │   │   p2cread, p2cwrite,                                        │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │               args = [                                                                       │ │
│ │                      │   'ffmpeg',                                                           │ │
│ │                      │   '-n',                                                               │ │
│ │                      │   '-headers',                                                         │ │
│ │                      │   'Referer: https://e69975b881.nl/',                                  │ │
│ │                      │   '-i',                                                               │ │
│ │                      │   None,                                                               │ │
│ │                      │   '-c',                                                               │ │
│ │                      │   'copy',                                                             │ │
│ │                      │   '/home/user/Videos/Metropolis (1927).mp4'             │ │
│ │                      ]                                                                       │ │
│ │            bufsize = -1                                                                      │ │
│ │            c2pread = -1                                                                      │ │
│ │           c2pwrite = -1                                                                      │ │
│ │          close_fds = True                                                                    │ │
│ │      creationflags = 0                                                                       │ │
│ │                cwd = None                                                                    │ │
│ │           encoding = None                                                                    │ │
│ │                env = None                                                                    │ │
│ │             errors = None                                                                    │ │
│ │            errread = -1                                                                      │ │
│ │           errwrite = -1                                                                      │ │
│ │         executable = None                                                                    │ │
│ │       extra_groups = None                                                                    │ │
│ │                gid = None                                                                    │ │
│ │               gids = None                                                                    │ │
│ │              group = None                                                                    │ │
│ │            p2cread = -1                                                                      │ │
│ │           p2cwrite = -1                                                                      │ │
│ │           pass_fds = ()                                                                      │ │
│ │           pipesize = -1                                                                      │ │
│ │         preexec_fn = None                                                                    │ │
│ │      process_group = -1                                                                      │ │
│ │    restore_signals = True                                                                    │ │
│ │               self = <Popen: returncode: None args: ['ffmpeg', '-n', '-headers', 'Referer:   │ │
│ │                      https:...>                                                              │ │
│ │              shell = False                                                                   │ │
│ │  start_new_session = False                                                                   │ │
│ │        startupinfo = None                                                                    │ │
│ │             stderr = None                                                                    │ │
│ │              stdin = None                                                                    │ │
│ │             stdout = None                                                                    │ │
│ │               text = None                                                                    │ │
│ │           to_close = []                                                                      │ │
│ │                uid = None                                                                    │ │
│ │              umask = -1                                                                      │ │
│ │ universal_newlines = None                                                                    │ │
│ │               user = None                                                                    │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /run/current-system/sw/lib/python3.11/subprocess.py:1883 in _execute_child                       │
│                                                                                                  │
│   1880 │   │   │   │   │   │   │   for dir in os.get_exec_path(env))                             │
│   1881 │   │   │   │   │   fds_to_keep = set(pass_fds)                                           │
│   1882 │   │   │   │   │   fds_to_keep.add(errpipe_write)                                        │
│ ❱ 1883 │   │   │   │   │   self.pid = _fork_exec(                                                │
│   1884 │   │   │   │   │   │   │   args, executable_list,                                        │
│   1885 │   │   │   │   │   │   │   close_fds, tuple(sorted(map(int, fds_to_keep))),              │
│   1886 │   │   │   │   │   │   │   cwd, env_list,                                                │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │              args = [                                                                        │ │
│ │                     │   'ffmpeg',                                                            │ │
│ │                     │   '-n',                                                                │ │
│ │                     │   '-headers',                                                          │ │
│ │                     │   'Referer: https://e69975b881.nl/',                                   │ │
│ │                     │   '-i',                                                                │ │
│ │                     │   None,                                                                │ │
│ │                     │   '-c',                                                                │ │
│ │                     │   'copy',                                                              │ │
│ │                     │   '/home/user/Videos/Metropolis (1927).mp4'              │ │
│ │                     ]                                                                        │ │
│ │           c2pread = -1                                                                       │ │
│ │          c2pwrite = -1                                                                       │ │
│ │         close_fds = True                                                                     │ │
│ │     creationflags = 0                                                                        │ │
│ │               cwd = None                                                                     │ │
│ │               env = None                                                                     │ │
│ │          env_list = None                                                                     │ │
│ │      errpipe_read = 3                                                                        │ │
│ │     errpipe_write = 19                                                                       │ │
│ │           errread = -1                                                                       │ │
│ │          errwrite = -1                                                                       │ │
│ │        executable = b'ffmpeg'                                                                │ │
│ │   executable_list = (                                                                        │ │
│ │                     │                                                                        │ │
│ │                     b'/nix/store/i4v8i5dcpyhxhzy11k7s2i75jb5f17yl-ffmpeg-6.1.1-man/bin/ffmp… │ │
│ │                     │                                                                        │ │
│ │                     b'/nix/store/c2rrw372x2s2kpan3xb53r9j8n5x3k4p-ffmpeg-6.1.1-bin/bin/ffmp… │ │
│ │                     │                                                                        │ │
│ │                     b'/nix/store/sif8a7y7p7r7wxpww2inxfrckni69c1a-fzf-0.47.0/bin/ffmpeg',    │ │
│ │                     │                                                                        │ │
│ │                     b'/nix/store/gdfkzjik3a2pbz9y3zn2a8w8szaay67c-fzf-0.47.0-man/bin/ffmpeg… │ │
│ │                     │   b'/home/user/.venv/py311/bin/ffmpeg',                                │ │
│ │                     │                                                                        │ │
│ │                     b'/nix/store/ncr2g7kbbsyis71d9fjngahihy6fq6g7-gnome-shell-extension-ddt… │ │
│ │                     │   b'/run/wrappers/bin/ffmpeg',                                         │ │
│ │                     │   b'/home/user/.nix-profile/bin/ffmpeg',                               │ │
│ │                     │   b'/nix/profile/bin/ffmpeg',                                          │ │
│ │                     │   b'/home/user/.local/state/nix/profile/bin/ffmpeg',                   │ │
│ │                     │   ... +3                                                               │ │
│ │                     )                                                                        │ │
│ │       fds_to_keep = {19}                                                                     │ │
│ │               gid = None                                                                     │ │
│ │              gids = None                                                                     │ │
│ │  low_fds_to_close = []                                                                       │ │
│ │   orig_executable = 'ffmpeg'                                                                 │ │
│ │           p2cread = -1                                                                       │ │
│ │          p2cwrite = -1                                                                       │ │
│ │          pass_fds = ()                                                                       │ │
│ │        preexec_fn = None                                                                     │ │
│ │     process_group = -1                                                                       │ │
│ │   restore_signals = True                                                                     │ │
│ │              self = <Popen: returncode: None args: ['ffmpeg', '-n', '-headers', 'Referer:    │ │
│ │                     https:...>                                                               │ │
│ │             shell = False                                                                    │ │
│ │ start_new_session = False                                                                    │ │
│ │       startupinfo = None                                                                     │ │
│ │               uid = None                                                                     │ │
│ │             umask = -1                                                                       │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: expected str, bytes or os.PathLike object, not NoneType

Platform (please complete the following information):

Additional context / possible cause or solution: In the past I was able to download this way, but sadly I don't remember which exact version of mov-cli I was using back then. It was definitely mov-cli v4.x though

Version mov-cli 4.2.12

r3tr0ananas commented 1 month ago

This is a plugin issue, not an mov-cli.

Please create an issue on https://github.com/JDALab/mov-cli-films

GreatTeacherOni commented 1 month ago

This is a plugin issue, not an mov-cli.

Please create an issue on https://github.com/JDALab/mov-cli-films

I created an issue there (see https://github.com/JDALab/mov-cli-films/issues/13#issue-2232211531) and will update after it is solved