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

that has problem in this function _get_ytplayer_config #11420

Closed
jav365 opened this issue Dec 12, 2016 · 3 comments
Closed

that has problem in this function _get_ytplayer_config #11420

jav365 opened this issue Dec 12, 2016 · 3 comments

Comments

@jav365
Copy link

@jav365 jav365 commented Dec 12, 2016

        r';ytplayer\.config\s*=\s*({.+?});ytplayer',
          r';ytplayer\.config\s*=\s*({.+?});',

In this case W6JhcjbWEwg that regex not work

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 12, 2016

Works fine here. Please paste your logs.

$ youtube-dl -vF "https://www.youtube.com/watch?v=W6JhcjbWEwg"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-vF', 'https://www.youtube.com/watch?v=W6JhcjbWEwg']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.09
[debug] Git HEAD: 18ece70
[debug] Python version 3.5.2 - Linux-4.8.12-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {}
[youtube] W6JhcjbWEwg: Downloading webpage
[youtube] W6JhcjbWEwg: Downloading embed webpage
[youtube] W6JhcjbWEwg: Refetching age-gated info webpage
[youtube] W6JhcjbWEwg: Extracting video information
[youtube] W6JhcjbWEwg: Downloading MPD manifest
[info] Available formats for W6JhcjbWEwg:
format code  extension  resolution note
171          webm       audio only DASH audio  121k , vorbis@128k (44100Hz), 4.64MiB
140          m4a        audio only DASH audio  128k , m4a_dash container, mp4a.40.2@128k (44100Hz), 6.08MiB
278          webm       256x144    DASH video  101k , webm container, vp9, 1fps, video only, 2.65MiB
160          mp4        256x144    DASH video  111k , avc1.42c00c, 15fps, video only, 5.22MiB
242          webm       426x240    DASH video  157k , vp9, 1fps, video only, 5.69MiB
133          mp4        426x240    DASH video  250k , avc1.4d4015, 30fps, video only, 11.68MiB
134          mp4        640x360    DASH video  265k , avc1.4d401e, 30fps, video only, 11.18MiB
243          webm       640x360    DASH video  298k , vp9, 1fps, video only, 10.72MiB
244          webm       854x480    DASH video  535k , vp9, 1fps, video only, 19.07MiB
135          mp4        854x480    DASH video  558k , avc1.4d401f, 30fps, video only, 23.53MiB
247          webm       1280x720   DASH video 1012k , vp9, 1fps, video only, 36.03MiB
136          mp4        1280x720   DASH video 1147k , avc1.4d401f, 30fps, video only, 47.72MiB
17           3gp        256x144    small , mp4v.20.3,  mp4a.40.2@ 24k
36           3gp        426x240    small , mp4v.20.3,  mp4a.40.2
43           webm       640x360    medium , vp8.0,  vorbis@128k
18           mp4        640x360    medium , avc1.42001E,  mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F,  mp4a.40.2@192k (best)
@jav365
Copy link
Author

@jav365 jav365 commented Dec 12, 2016

/;ytplayer\.config\s*=\s*({.+?});ytplayer/.exec(/* string of youtube's page*/) or /;ytplayer\.config\s*=\s*({.+?});/.exec(/* string of youtube's page*/)
why is null returned,what's wrong with it

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 12, 2016

Seems you're using Javascript? First, regular expressions in different languages are not the same. An expression working in Python does not guarantee working in Javascript or Perl or PHP. Second, what YouTube returns depends on User-Agent string. youtube-dl uses a custom User-Agent

Closing as it's not youtube-dl's problem.

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.