Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twitch_vod_fetch --ytdl-output-format option can't move output file to another drive on Windows #7

Closed
Choonster opened this issue May 31, 2017 · 2 comments

Comments

@Choonster
Copy link
Contributor

When the --ytdl-output-format option is used to specify a location on a different drive to the temporary files, the file_dst_path.rename call fails with this error:

Traceback (most recent call last):
  File "C:\Users\USER\Documents\GitHub\fgtk\desktop\media\twitch_vod_fetch", line 900, in <module>
    if __name__ == '__main__': sys.exit(main())
  File "C:\Users\USER\Documents\GitHub\fgtk\desktop\media\twitch_vod_fetch", line 896, in main
    loop, conf, vod_queue, list_formats_only=opts.ytdl_list_formats ))
  File "C:\Program Files\Python36\lib\asyncio\base_events.py", line 466, in run_until_complete
    return future.result()
  File "C:\Users\USER\Documents\GitHub\fgtk\desktop\media\twitch_vod_fetch", line 273, in vod_fetch
    try: await fetch(url, prefix, info_suffix=info_suffix)
  File "C:\Users\USER\Documents\GitHub\fgtk\desktop\media\twitch_vod_fetch", line 189, in _wrapper
    return await func(self, ctx, *args, **kws)
  File "C:\Users\USER\Documents\GitHub\fgtk\desktop\media\twitch_vod_fetch", line 766, in get
    file_dst_path.rename(file_dst_done)
  File "C:\Program Files\Python36\lib\pathlib.py", line 1292, in rename
    self._accessor.rename(self, target)
  File "C:\Program Files\Python36\lib\pathlib.py", line 396, in wrapped
    return strfunc(str(pathobjA), str(pathobjB), *args)
OSError: [WinError 17] The system cannot move the file to a different disk drive: '..\\download_temp\\Dave.mp4' -> 
'C:\\Users\\USER\\Downloads\\LivestreamDownloads\\KirinDave\\20170529 - X of 2 - GAME - Chill with Minecraft & Dave 
For A Bit - v148136907.mp4'

shutil.move can be used to move a file to another location, including across drives.

@Choonster Choonster changed the title twitch_vod_fetch --ytdl-output-format option can't move output file to another Windows drive twitch_vod_fetch --ytdl-output-format option can't move output file to another drive on Windows May 31, 2017
@mk-fg
Copy link
Owner

mk-fg commented May 31, 2017

Should be fixed in 8c0d93f, didn't consider that youtube-dl filenames can have full path instead just name at all. Thanks.

@mk-fg mk-fg closed this as completed May 31, 2017
@Choonster
Copy link
Contributor Author

That fixed it, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants