Media extractor quality

hi,
ive set up media extractor to auto script youtube channel to my tv yet the quality is no rubbish. ive added default_query: best.
yet i can cast from my phone and get better quality is there anyway to improve it

youtubepuzzle:
   alias: Chris R Puzzles
   sequence:
   - service: media_extractor.play_media
     entity_id: media_player.shield
     data_template:
      media_content_id: "https://www.youtube.com/watch?v={{ states('sensor.yt_puzzle') }}"
      media_content_type: video/youtube
      default_query: bestvideo
1 Like

I’m having the same problem. Even with best, youtube seems to default to 1080p.
I was able to force the video to 4k in the configuration file, but it doesn’t include audio. Also you need to specify the default_query in your configuration.yaml
I documented it here:

Hi,
I got around my issue which might not work for others,

I have a sensor that checked for the id of the latest video uploaded by my favorite youtubers

# GameRanx
- platform: scrape
  resource: 'https://www.youtube.com/feeds/videos.xml?channel_id=UCNvzD7Z-g64bPXxGzaQaa4g'
  name: yt_gameranx
  select: yt\:videoid

I then had an automation to retain the id for the video I most wanted

- alias: youtube_gameranx_fri
  initial_state: 'on'
  trigger:
      - platform: time
        at: '03:00:00'
  condition:
  - condition: time
    weekday:
      - sat
  action:
      - service: input_text.set_value
        # Again, note the use of 'data_template:' rather than the normal 'data:' if you weren't using an input variable.
        data_template:
          entity_id: input_text.youtube_gameranx
          value: "{{ states('sensor.yt_gameranx') }}"

this is a weekly video that talks about the latest gaming new of the week.

I then used it to feed my saturday morning routine, I grab my self a coffee and watched my videos.

- alias: 'Sat Youtube automation'
  trigger:
    - platform: state
      entity_id: input_boolean.youtube_routine
      from: 'off'
      to: 'on'
  action:
  - delay: '00:00:10'
  - wait_template: "{{ is_state('media_player.nvidia_shield', 'standby') }}"
  - service: androidtv.adb_command
    data_template:
      entity_id: media_player.nvidia_shield
      command: am start -a android.intent.action.VIEW https://www.youtube.com/watch?v={{ states('input_text.youtube_gameranx') }}
  - delay: '00:00:20'
  - wait_template: "{{ is_state('media_player.nvidia_shield', 'standby') }}"
  - service: androidtv.adb_command
    data_template:
      entity_id: media_player.nvidia_shield
      command: am start -a android.intent.action.VIEW https://www.youtube.com/watch?v={{ states('input_text.youtube_puzzle') }}
  - service: input_boolean.turn_off
    entity_id: input_boolean.youtube_routine