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

"File name too long" for .info.json.xxxxxxxx.tmp file #7217

Open
ivan opened this issue Oct 18, 2015 · 3 comments
Open

"File name too long" for .info.json.xxxxxxxx.tmp file #7217

ivan opened this issue Oct 18, 2015 · 3 comments

Comments

@ivan
Copy link
Contributor

@ivan ivan commented Oct 18, 2015

This works on Windows, but on Linux, the filename is too long:

# PYTHONPATH=. python3 -m youtube_dl --verbose --title --write-info-json "n_8yNCMM2_0"     
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', '--title', '--write-info-json', 'n_8yNCMM2_0']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.10.16
[debug] Git HEAD: 49941c4
[debug] Python version 3.4.3 - Linux-3.19.0-30-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] n_8yNCMM2_0: Downloading webpage
[youtube] n_8yNCMM2_0: Downloading video info webpage
[youtube] n_8yNCMM2_0: Extracting video information
[youtube] {43} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {18} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {5} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {36} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {17} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {134} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {243} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {133} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {242} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {160} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {140} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {171} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {249} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {250} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] {251} signature length 40.43, html5 player new-en_US-vflDpriqR
[youtube] n_8yNCMM2_0: Downloading DASH manifest
[info] Writing video description metadata as JSON to: 青山ロックンロール・レイディオ Vol.17~今回はフランキー・ヴァリにMASTERS OF POP、さらに9_24発売の充実でお買い得な『2CDベスト1800』シリーズを一気にご紹介!-n_8yNCMM2_0.info.json
ERROR: Cannot write metadata to JSON file 青山ロックンロール・レイディオ Vol.17~今回はフランキー・ヴァリにMASTERS OF POP、さらに9_24発売の充実でお買い得な『2CDベスト1800』シリーズを一気にご紹介!-n_8yNCMM2_0.info.json
Traceback (most recent call last):
  File "/home/at/yt/youtube-dl/youtube_dl/YoutubeDL.py", line 1524, in process_info
    write_json_file(self.filter_requested_info(info_dict), infofn)
  File "/home/at/yt/youtube-dl/youtube_dl/utils.py", line 120, in write_json_file
    tf = tempfile.NamedTemporaryFile(**compat_kwargs(args))
  File "/usr/lib/python3.4/tempfile.py", line 599, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib/python3.4/tempfile.py", line 339, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
OSError: [Errno 36] File name too long: '青山ロックンロール・レイディオ\u3000Vol.17~今回はフランキー・ヴァリにMASTERS OF POP、さらに9_24発売の充実でお買い得な『2CDベスト1800』シリーズを一気にご紹介!-n_8yNCMM2_0.info.json.s0v5rpkk.tmp'
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 18, 2015

There's a fix at #6442, which is still under discussion.

@Tatsh
Copy link
Contributor

@Tatsh Tatsh commented Feb 8, 2018

If it is acceptable, truncate the title: --output '%(title).128s-%(id)s.%(ext)s

@jm3
Copy link

@jm3 jm3 commented Jan 5, 2020

@Tatsh thanks for this tip, just saved me some hassle!

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.