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

[Instagram] Filename Error with Usernames ending in Underscores. #21461

Open
tooxo opened this issue Jun 20, 2019 · 3 comments
Open

[Instagram] Filename Error with Usernames ending in Underscores. #21461

tooxo opened this issue Jun 20, 2019 · 3 comments

Comments

@tooxo
Copy link

@tooxo tooxo commented Jun 20, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.06.08
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/By72ZbWBjIh/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.05.11
[debug] Python version 3.6.8 (CPython) - Linux-4.15.0-51-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[Instagram] By72ZbWBjIh: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/db7bf27cd0417ba2b7bfc8c3d6e4bd7a/5D0E2477/t50.2886-16/65021121_402156337055014_2754111550510858240_n.mp4?_nc_ht=scontent.cdninstagram.com'
[download] Destination: Video by _grucci-By72ZbWBjIh.mp4
[download] 100% of 3.80MiB in 00:00

Description

Videos downloaded from Instagram, with the creators username ending in an underscore(_) are downloaded into a filename without the underscore in it.
Example:
User: _test_
Test-Post: https://instagram.com/p/abc123

youtube-dl -v https://instagram.com/p/abc123

Expected Result:

A file called: "Video by _test_-abc123.mp4"

Actual Result:

A file called: "Video by _test-abc123.mp4"
@nyuszika7h
Copy link
Contributor

@nyuszika7h nyuszika7h commented Jun 29, 2019

It seems like the underscores are stripped when %(title)s is used in the output template, which is the default. If you explicitly specify %(uploader_id)s instead, you get the expected result.

Incorrect (default output template)

% youtube-dl -v 'https://www.instagram.com/p/BxzJ3aIhU9N/'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/BxzJ3aIhU9N/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.18
[debug] Git HEAD: 7dd5014
[debug] Python version 3.7.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94057-g1c3ed11893, ffprobe N-94057-g1c3ed11893
[debug] Proxy map: {}
[Instagram] BxzJ3aIhU9N: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/134030474b8c29ba5489b12b5d0cef53/5D198A0D/t50.2886-16/61285320_1683272141775125_6670682527300730582_n.mp4?_nc_ht=scontent.
cdninstagram.com'
[download] Destination: Video by sooyaaa-BxzJ3aIhU9N.mp4
[download] 100% of 987.92KiB in 00:00

Incorrect (explicitly specified default)

% youtube-dl -v 'https://www.instagram.com/p/BxzJ3aIhU9N/' -o '%(title)s-%(id)s.%(ext)s'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/BxzJ3aIhU9N/', '-o', '%(title)s-%(id)s.%(ext)s']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.18
[debug] Git HEAD: 7dd5014
[debug] Python version 3.7.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94057-g1c3ed11893, ffprobe N-94057-g1c3ed11893
[debug] Proxy map: {}
[Instagram] BxzJ3aIhU9N: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/134030474b8c29ba5489b12b5d0cef53/5D198A0D/t50.2886-16/61285320_1683272141775125_6670682527300730582_n.mp4?_nc_ht=scontent.cdninstagram.com'
[download] Destination: Video by sooyaaa-BxzJ3aIhU9N.mp4
[download] 100% of 987.92KiB in 00:00

Correct

% youtube-dl -v 'https://www.instagram.com/p/BxzJ3aIhU9N/' -o 'Video by %(uploader_id)s-%(id)s.%(ext)s'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/BxzJ3aIhU9N/', '-o', 'Video by %(uploader_id)s-%(id)s.%(ext)s']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.18
[debug] Git HEAD: 7dd5014
[debug] Python version 3.7.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94057-g1c3ed11893, ffprobe N-94057-g1c3ed11893
[debug] Proxy map: {}
[Instagram] BxzJ3aIhU9N: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/134030474b8c29ba5489b12b5d0cef53/5D198A0D/t50.2886-16/61285320_1683272141775125_6670682527300730582_n.mp4?_nc_ht=scontent.cdninstagram.com'
[download] Destination: Video by sooyaaa__-BxzJ3aIhU9N.mp4
[download] 100% of 987.92KiB in 00:00
@tooxo
Copy link
Author

@tooxo tooxo commented Jun 29, 2019

It seems like the underscores are stripped when %(title)s is used in the output template, which is the default. If you explicitly specify %(uploader_id)s instead, you get the expected result.

Incorrect (default output template)

% youtube-dl -v 'https://www.instagram.com/p/BxzJ3aIhU9N/'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/BxzJ3aIhU9N/']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.18
[debug] Git HEAD: 7dd5014
[debug] Python version 3.7.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94057-g1c3ed11893, ffprobe N-94057-g1c3ed11893
[debug] Proxy map: {}
[Instagram] BxzJ3aIhU9N: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/134030474b8c29ba5489b12b5d0cef53/5D198A0D/t50.2886-16/61285320_1683272141775125_6670682527300730582_n.mp4?_nc_ht=scontent.
cdninstagram.com'
[download] Destination: Video by sooyaaa-BxzJ3aIhU9N.mp4
[download] 100% of 987.92KiB in 00:00

Incorrect (explicitly specified default)

% youtube-dl -v 'https://www.instagram.com/p/BxzJ3aIhU9N/' -o '%(title)s-%(id)s.%(ext)s'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/BxzJ3aIhU9N/', '-o', '%(title)s-%(id)s.%(ext)s']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.18
[debug] Git HEAD: 7dd5014
[debug] Python version 3.7.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94057-g1c3ed11893, ffprobe N-94057-g1c3ed11893
[debug] Proxy map: {}
[Instagram] BxzJ3aIhU9N: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/134030474b8c29ba5489b12b5d0cef53/5D198A0D/t50.2886-16/61285320_1683272141775125_6670682527300730582_n.mp4?_nc_ht=scontent.cdninstagram.com'
[download] Destination: Video by sooyaaa-BxzJ3aIhU9N.mp4
[download] 100% of 987.92KiB in 00:00

Correct

% youtube-dl -v 'https://www.instagram.com/p/BxzJ3aIhU9N/' -o 'Video by %(uploader_id)s-%(id)s.%(ext)s'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.instagram.com/p/BxzJ3aIhU9N/', '-o', 'Video by %(uploader_id)s-%(id)s.%(ext)s']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.02.18
[debug] Git HEAD: 7dd5014
[debug] Python version 3.7.3 (CPython) - Linux-4.9.0-9-amd64-x86_64-with-debian-9.9
[debug] exe versions: ffmpeg N-94057-g1c3ed11893, ffprobe N-94057-g1c3ed11893
[debug] Proxy map: {}
[Instagram] BxzJ3aIhU9N: Downloading webpage
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://scontent.cdninstagram.com/vp/134030474b8c29ba5489b12b5d0cef53/5D198A0D/t50.2886-16/61285320_1683272141775125_6670682527300730582_n.mp4?_nc_ht=scontent.cdninstagram.com'
[download] Destination: Video by sooyaaa__-BxzJ3aIhU9N.mp4
[download] 100% of 987.92KiB in 00:00

Is this expected behaviour?

@nyuszika7h
Copy link
Contributor

@nyuszika7h nyuszika7h commented Jun 29, 2019

I'm not sure, I haven't found where in the code it would even trim underscores from the title.

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
2 participants
You can’t perform that action at this time.