Skip to content
This repository was archived by the owner on Mar 28, 2024. It is now read-only.

Folder names might be invalid #89

Open
OevreFlataeker opened this issue Mar 2, 2024 · 1 comment
Open

Folder names might be invalid #89

OevreFlataeker opened this issue Mar 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@OevreFlataeker
Copy link

OevreFlataeker commented Mar 2, 2024

When I tried to download S02 from https://www.bbc.co.uk/iplayer/episodes/m0015167/marcus-wareings-tales-from-a-kitchen-garden freevine properly downloaded the stream but was not able to store it, as the MPD(?) apparently had a after the end of the name, and Windows foldernames cannot have a blank as the last character. So the folder was created w/o the blank and the subsequent steps to mux failed with "File not found". You can clearly see the additional " " at the end of the directory path in the stacktrace.

To Reproduce

(.venv) F:\freevine>freevine.py get --season  s02 https://www.bbc.co.uk/iplayer/episodes/m0015167/marcus-wareings-tales-from-a-kitchen-garden  -sv res=720
15:34:23.717 INFO : BBC iPlayer
15:34:24.612 INFO : Marcus Wareing's Tales from a Kitchen Garden : 2 Season(s), 30 Episode(s)

Traceback (most recent call last):
  File "c:\Python310\lib\pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'downloads\\Marcus Wareings Tales from a Kitchen Garden \\Season 02'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\freevine\freevine.py", line 15, in <module>
    cli()
  File "F:\freevine\.venv\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "F:\freevine\.venv\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "F:\freevine\.venv\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "F:\freevine\.venv\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "F:\freevine\.venv\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "F:\freevine\utils\commands.py", line 90, in get
    Service(config, **kwargs)
  File "F:\freevine\services\bbciplayer\bbciplayer.py", line 51, in __init__
    self.get_options()
  File "F:\freevine\services\bbciplayer\bbciplayer.py", line 369, in get_options
    self.download(download, title)
  File "F:\freevine\services\bbciplayer\bbciplayer.py", line 376, in download
    self.save_path = set_save_path(stream, self, title)
  File "F:\freevine\utils\utilities.py", line 441, in set_save_path
    save_path.mkdir(parents=True, exist_ok=True)
  File "c:\Python310\lib\pathlib.py", line 1180, in mkdir
    self.mkdir(mode, parents=False, exist_ok=exist_ok)
  File "c:\Python310\lib\pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'downloads\\Marcus Wareings Tales from a Kitchen Garden \\Season 02'

(.venv) F:\freevine>md "\\?\f:\freevine\downloads\Marcus Wareings Tales from a Kitchen Garden "

Expected behavior
freevine can handle even erraneous filenames.

Suggestion is to strip() all names/paths so in case something is unexpected it won´t affect the filesystem naming.

@OevreFlataeker OevreFlataeker added the bug Something isn't working label Mar 2, 2024
@stabbedbybrick
Copy link
Owner

Good call. It's been fixed in the latest commit: c3ea99d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants