{"action":"opened","issue":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/4787","labels_url":"https://api.github.com/repos/rg3/youtube-dl/issues/4787/labels{/name}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/4787/comments","events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/4787/events","html_url":"https://github.com/rg3/youtube-dl/issues/4787","id":55497103,"number":4787,"title":"Non-existent paths passed to ffmpeg/ffprobe/etc due to `encodeFilename`","user":{"login":"dstftw","id":1908898,"avatar_url":"https://avatars.githubusercontent.com/u/1908898?v=3","gravatar_id":"","url":"https://api.github.com/users/dstftw","html_url":"https://github.com/dstftw","followers_url":"https://api.github.com/users/dstftw/followers","following_url":"https://api.github.com/users/dstftw/following{/other_user}","gists_url":"https://api.github.com/users/dstftw/gists{/gist_id}","starred_url":"https://api.github.com/users/dstftw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstftw/subscriptions","organizations_url":"https://api.github.com/users/dstftw/orgs","repos_url":"https://api.github.com/users/dstftw/repos","events_url":"https://api.github.com/users/dstftw/events{/privacy}","received_events_url":"https://api.github.com/users/dstftw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rg3/youtube-dl/labels/bug","name":"bug","color":"ff0303"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-26T15:43:00Z","updated_at":"2015-01-26T15:43:00Z","closed_at":null,"body":"b0e87c311078cf8510c720d50d4960a87f43296b did not fix the conceptual problem. When filepath is encoded with `encodeFilename(path, True)` on python 2 @ Windows it may end up with non existent path (e.g. `Trentemøller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.m4a` becomes `Trentemoller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.m4a`, `ø` becomes `o`). And this non-existent path is passed to ffmpeg/ffprobe/whatever.\r\nPossible workarounds are:\r\n* Encode filepaths with `encodeFilename(path, True)` before writing to disk.\r\n* Perform all the subprocessing on temporary file with plain ASCII name and rollback to original name right after it's done.\r\n* Provide compat subprocess implementation that works with unicode, as we do for lots of broken stuff in python2 (this would probably require copypasting and adapting the whole `subprocess.py` from cpython 3 or so).\r\n\r\n```\r\n>python -m youtube_dl -f 160+140 -v Y9o7ILCPSFU\r\n[debug] System config: []\r\n[debug] User config: []\r\n[debug] Command-line args: ['-f', '160+140', '-v', 'Y9o7ILCPSFU']\r\n[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251\r\n[debug] youtube-dl version 2015.01.23.4\r\n[debug] Git HEAD: 80a49d3\r\n[debug] Python version 2.7.6 - Windows-2003Server-5.2.3790-SP2\r\n[debug] exe versions: ffmpeg N-68756-g627f565, ffprobe N-68694-g7c210c4, rtmpdump 2.3\r\n[debug] Proxy map: {}\r\n[youtube] Y9o7ILCPSFU: Downloading webpage\r\n[youtube] Y9o7ILCPSFU: Extracting video information\r\n[youtube] Y9o7ILCPSFU: Downloading DASH manifest\r\n[debug] Invoking downloader on 'https://r19---sn-oguesne6.googlevideo.com/videoplayback?id=63da3b20b08f4855&itag=160&source=youtube&requiressl=yes&pl=22&mv=m&ms=au&mm=31&nh=IgpwcjAyLm5ydDE5KgkxMjcuMC4wLjE&ratebypass=yes&mime=video/mp4&gir=yes&clen=1646278&lmt=1418493117455845&dur=272.105&mt=1422286131&upn=ST6SA4yKetw&signature=5982C88337984594B47DD0AE038E9E079D694B4F.09BBB44FE6C75594F04EF70F97E252516F31940D&key=dg_yt0&sver=3&fexp=900718,907263,922243,924638,927622,930016,9406\r\n082,9406326,941004,943917,947225,948124,952302,952605,952901,955301,957103,95710\r\n5,957201,959701,962715&ip=PRIVATE&ipbits=0&expire=1422307758&sparams=ip,ip\r\nbits,expire,id,itag,source,requiressl,pl,mv,ms,mm,nh,ratebypass,mime,gir,clen,lmt,dur'\r\n[download] Destination: Trentemøller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.f160.mp4\r\n[download] 100% of 1.57MiB in 00:33\r\n[debug] Invoking downloader on 'https://r19---sn-oguesne6.googlevideo.com/videoplayback?id=63da3b20b08f4855&itag=140&source=youtube&requiressl=yes&pl=22&mv=m&ms=au&mm=31&nh=IgpwcjAyLm5ydDE5KgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/mp4&gir=yes&clen=4371063&lmt=1418493113768940&dur=272.230&mt=1422286131&upn=ST6SA4yKetw&signature=23BBC9979391613C6CBE8C5FC1E54B3E01BEF5D7.8686958B23B344D9E7E24C1AF687379F4D291A47&key=dg_yt0&sver=3&fexp=900718,907263,922243,924638,927622,930016,9406082,9406326,941004,943917,947225,948124,952302,952605,952901,955301,957103,957105,957201,959701,962715&ip=PRIVATE&ipbits=0&expire=1422307758&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mv,ms,mm,nh,ratebypass,mime,gir,clen,lm\r\nt,dur'\r\n[download] Destination: Trentemøller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.f140.m4a\r\n[download] 100% of 4.17MiB in 01:46\r\n[ffmpeg] Merging formats into \"Trentemøller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.mp4\"\r\n[debug] ffmpeg command line: ffmpeg -y -i 'Trentemller - Miss You (Mahmut OrhanRemix)-Y9o7ILCPSFU.f160.mp4' -i 'Trentemller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 'Trentemller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.mp4'\r\nERROR: Trentemller - Miss You (Mahmut Orhan Remix)-Y9o7ILCPSFU.f160.mp4: No such file or directory\r\nTraceback (most recent call last):\r\n  File \"youtube_dl\\YoutubeDL.py\", line 1384, in post_process\r\n    keep_video_wish, info = pp.run(info)\r\n  File \"youtube_dl\\postprocessor\\ffmpeg.py\", line 544, in run\r\n    self.run_ffmpeg_multiple_files(info['__files_to_merge'], filename, args)\r\n  File \"youtube_dl\\postprocessor\\ffmpeg.py\", line 103, in run_ffmpeg_multiple_files\r\n    raise FFmpegPostProcessorError(msg)\r\nFFmpegPostProcessorError\r\n```"}}