aajanki / yle-dl

Download videos from Yle servers
https://aajanki.github.io/yle-dl/index-en.html
GNU General Public License v3.0
302 stars 52 forks source link

Support 4K streams #335

Closed 2-4601 closed 3 weeks ago

2-4601 commented 1 year ago

Yle Areena sometimes offers 4K streams.

For example: https://areena.yle.fi/1-64123652 (Note that the stream expires after the event has passed but you can probably find another 4K example with an upcoming match.)

The stream has the following remark about 4K quality:

"Tämä lähetys on Suomessa katsottavissa uudemmilla äly-tv-laitteilla 4K-laatuisena, mikäli verkkoyhteys on riittävän nopea."

Debug run:

$ yle-dl --debug https://areena.yle.fi/1-64123652
yle-dl 20221111: Download media files from Yle Areena and Elävä Arkisto
Copyright (C) 2009-2022 Antti Ajanki <antti.ajanki@iki.fi>, license: GPLv3

DEBUG: https://areena.yle.fi/1-64123652 is an Areena URL
DEBUG: HTTP GET https://areena.yle.fi/1-64123652
DEBUG: HTTP status code: 200
DEBUG: HTTP response headers:
DEBUG: Content-Type: text/html; charset=utf-8
DEBUG: Transfer-Encoding: chunked
DEBUG: Connection: keep-alive
DEBUG: Date: Sat, 26 Nov 2022 11:03:41 GMT
DEBUG: Cache-Control: max-age=60
DEBUG: X-Powered-By: Next.js
DEBUG: Content-Encoding: gzip
DEBUG: Vary: Cookie,Accept-Encoding
DEBUG: X-Cache: Hit from cloudfront
DEBUG: Via: 1.1 4ded1750dc7e0bef188a5520fb9fef28.cloudfront.net (CloudFront)
DEBUG: X-Amz-Cf-Pop: ARN56-P1
DEBUG: X-Amz-Cf-Id: 7TEnr8vVSAEJT9eZkdsjR65Wy8DhB8VrI1mEhvwxYDKEsTV7cVJtUg==
DEBUG: Age: 34
DEBUG: Not a playlist
DEBUG: HTTP GET https://player.api.yle.fi/v1/preview/1-64123652.json?language=fin&ssl=true&countryCode=FI&host=areenaylefi&app_id=player_static_prod&app_key=8930d72170e48303cf5f3867780d549b
DEBUG: HTTP status code: 200
DEBUG: HTTP response headers:
DEBUG: Content-Type: application/json;charset=utf-8
DEBUG: Transfer-Encoding: chunked
DEBUG: Connection: keep-alive
DEBUG: Date: Sat, 26 Nov 2022 11:04:15 GMT
DEBUG: Server: nginx/1.23.1
DEBUG: Cache-Control: max-age=30
DEBUG: Access-Control-Allow-Methods: GET, HEAD, OPTIONS
DEBUG: Access-Control-Allow-Origin: https://areena.yle.fi
DEBUG: Access-Control-Allow-Credentials: true
DEBUG: Content-Encoding: gzip
DEBUG: Vary: Accept-Encoding
DEBUG: X-Cache: Miss from cloudfront
DEBUG: Via: 1.1 797e08d987207122bff536abc6502d6c.cloudfront.net (CloudFront)
DEBUG: X-Amz-Cf-Pop: ARN56-P1
DEBUG: X-Amz-Cf-Id: G8XzPBuM6uBX67YvYQDQFOKvizgrYB1xp6bMSFluE4rJSYYBcqbwTw==
DEBUG: preview data:
{
  "meta": {
    "id": "1-64123652"
  },
  "data": {
    "ongoing_event": {
      "description": {
        "fin": "D-lohkon ottelu Tunisia - Australia. Al Wakrah, Qatar. Selostus Velja Engstr\u00f6m.\n\nT\u00e4m\u00e4 l\u00e4hetys on Suomessa katsottavissa uudemmilla \u00e4ly-tv-laitteilla 4K-laatuisena, mik\u00e4li verkkoyhteys on riitt\u00e4v\u00e4n nopea. ",
        "swe": "S\u00e4ndningen refereras p\u00e5 finska."
      },
      "subtitles": [],
      "auto_subtitles": false,
      "media_id": "79-a5a393d898f1420eb70ad65a2449832a",
      "series": {
        "id": "1-63499961",
        "title": {
          "fin": "FIFAn jalkapallon MM 2022",
          "swe": "FIFA fotbolls-VM 2022"
        }
      },
      "program_id": "1-64123652",
      "dvr_window_in_seconds": 0,
      "cuepoints": [],
      "start_time": "2022-11-26T11:50:00.000+02:00",
      "duration": {
        "duration_in_seconds": 9600,
        "h": 0,
        "m": 0,
        "s": 9600
      },
      "is_content_protected": true,
      "title": {
        "fin": "Tunisia - Australia (4K)"
      },
      "region": "Finland",
      "content_type": "VideoObject",
      "is_areena_visible": true,
      "adobe": {
        "category": "urheilu",
        "yle_country_code": "FI",
        "yle_title": "fifan jalkapallon mm 2022",
        "fp_clnr": "20001",
        "yle_service_id": "yle-areena",
        "yle_ss_ohjusid": "1-64123652",
        "yle_ss_prodnumber": "99740440689",
        "yle_ss_mediaid": "79-a5a393d898f1420eb70ad65a2449832a",
        "ns_st_ep": "20221126",
        "ns_st_el": "0",
        "ns_st_dt": "20221126",
        "yle_id": "1-64123652",
        "ns_st_st": "vain_areenassa",
        "ns_st_li": "1",
        "fp_ch": "fp198",
        "yle_language": "fi",
        "ns_st_ty": "livetv",
        "countername": "urheilu.livetv.vain_areenassa.fifan jalkapallon mm 2022",
        "yle_stickytitle": "tunisia - australia (4k)",
        "yle_metrics_api_data_version": "v2.1",
        "fp_bd": "20221126",
        "yle_dayssincepublish": "0",
        "yle_truelength": "0",
        "fp_prod_id": "na",
        "fp_ty": "video_web_program",
        "content_type": "livetv",
        "ns_st_pr": "urheilu.livetv.vain_areenassa.fifan jalkapallon mm 2022",
        "yle_publication_event_id": "4-64123653",
        "yle_media_type": "TVContent",
        "ns_st_cl": "0",
        "yle_publication_event_type": "ScheduledTransmission",
        "ns_st_ci": "54-1-64123652",
        "ns_st_pl": "urheilu.livetv.vain_areenassa.fifan jalkapallon mm 2022.20221126",
        "yle_media_id": "79-a5a393d898f1420eb70ad65a2449832a"
      },
      "image": {
        "id": "13-1-64123652-1668156654537",
        "version": 1669456208
      },
      "service_id": "yle-areena",
      "manifest_url": "https://yleuhdlive4.akamaized.net/live/finland/63a72dc5b3474e2c87b51df561ca91f6/playlist.m3u8?aws.manifestfilter=video_codec:h264&hdnts=exp=1669464255~acl=/live/finland/63a72dc5b3474e2c87b51df561ca91f6/*~hmac=713f4d92144505fb6b28a8cc2cad997771845d6debf238dd70352071cd650366",
      "content_rating": {
        "age_restriction": null,
        "reasons": null
      }
    }
  }
}
DEBUG: Available flavors:
DEBUG: bitrate: None, height: None, width: None
DEBUG: max_height: None, max_bitrate: None
DEBUG: Selected flavor: FailedFlavor(media_type='unknown', height=None, width=None, bitrate=None, streams=[<yledl.backends.FailingBackend object at 0x7f954dd81510>])
ERROR: Unsupported stream: Unknown stream flavor
DEBUG: HTTP GET https://locations.api.yle.fi/v1/address/current?app_id=player_static_prod&app_key=8930d72170e48303cf5f3867780d549b
DEBUG: HTTP status code: 200
DEBUG: HTTP response headers:
DEBUG: Content-Type: application/json;charset=utf-8
DEBUG: Content-Length: 63
DEBUG: Connection: keep-alive
DEBUG: Date: Sat, 26 Nov 2022 11:04:15 GMT
DEBUG: Server: nginx/1.23.1
DEBUG: Cache-Control: no-cache, no-store, must-revalidate
DEBUG: X-Cache: Miss from cloudfront
DEBUG: Via: 1.1 0078c2805bf98a4574ea5eee972aa9f6.cloudfront.net (CloudFront)
DEBUG: X-Amz-Cf-Pop: ARN56-P1
DEBUG: X-Amz-Cf-Id: hWJ6lTRGvQMvQWUMXI3YTB1QZNLKMfMD9aM9hOiF8N_TbbDcGA_zRA==
DEBUG: Geo query response:
DEBUG: {"country_code": "FI", "continent": "EU", "asnum": "1759", "eu": true}
ghost commented 10 months ago

Do the 4K streams play in the browser like the other resolutions? The note about smart TVs is just an uninformed oversight and doesn't imply that YLE has attempted to restrict the streams with a DRM-like measure?

aajanki commented 10 months ago

Does anyone know if it possible to find streams that are available at 4K resolution in Areena? I can't find any currently. The stream mentioned in the original post was expired before I had a change to take a look at it.

aajanki commented 3 weeks ago

I'm closing this issue for now. I'll get back to this if/when Areena starts servering 4K resolution more regularly.