Media_extractor being selective for no reason?

Hello,

I have 3 scripts that I can trigger which play different type of youtube videos on my chromecast.

In the configuration.yaml I have the following (among other things):

media_extractor:

scripts:
hiphopjazz:
  alias: Hip Hop Jazz 1hr
  sequence:
    - service: media_extractor.play_media
      entity_id: media_player.woonkamer
      data:
        media_content_id: "https://www.youtube.com/watch?v=F3OFIuIXcSo"
        media_content_type: video/youtube
        
restaurant:
  alias: Restaurant 10h
  sequence:
    - service: media_extractor.play_media
      entity_id: media_player.woonkamer
      data:
        media_content_id: "https://www.youtube.com/watch?v=v5bClGpH0iI"
        media_content_type: video/youtube
        
jazzladies:
  alias: Jazz ladies 2hr
  sequence:
    - service: media_extractor.play_media
      entity_id: media_player.woonkamer
      data:
        media_content_id: "https://www.youtube.com/watch?v=CsJs_hEC_4E"
        media_content_type: video/youtube

The 3 youtube links are:
https://www.youtube.com/watch?v=F3OFIuIXcSo
https://www.youtube.com/watch?v=v5bClGpH0iI
https://www.youtube.com/watch?v=CsJs_hEC_4E

However only the 10hr restaurant video is working.
Anybody any clue why media_extractor is being selective?

edit:
The log shows 2 errors from the media extractor:

## Log Details (ERROR)

Thu Sep 20 2018 09:39:13 GMT+0200 (Central European Summer Time)

Could not retrieve data for the URL: https://www.youtube.com/watch?v=CsJs_hEC_4E

Log Details (ERROR)
Thu Sep 20 2018 09:39:13 GMT+0200 (Central European Summer Time)

ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1210, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1121, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/youtube.py", line 1182, in _parse_sig_js
    jscode, 'Initial JS player signature function name', group='sig')
  File "/usr/local/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 972, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player signature function name; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
 (caused by RegexNotFoundError('Unable to extract Initial JS player signature function name; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

The error is giving you directions in the error:

youtube_dl.utils.RegexNotFoundError: Unable to extract Initial JS player signature function name; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

I have the same issue. Not every youtube links seem to work. Did you fix this problem?

@goprojojo, working on it.

So I found a closed issue that looks similar and is recent.
It was closed as an old version was used.

Latest version of youtube-dl is 2018.09.18

on 2018-09-20 media extractor component merged the new version, see this issue

Solution is likely going to be in the new version.
It was merged in the dev branch, but I do not know how we can see in which new version it will be published in the master branch.

I did not update further then 0.76.2 as I cannot find the time to move to the new user login thing (scared that I need to put some time in to fix that I can login)

However, this problem will very likely be fixed in future releases.
I also think it will be unstable as youtube might remove or change the video.
Better solution would be to pull the content local and play through plex or similar.
Also working on how to do that, as I cannot find a working example on-line.
When I find out I will post a example to the plex component website section.

1 Like