Skip to content

Conversation

@bastimeyer
Copy link
Member

The {id} metadata is useful for writing unique file names to the filesystem when recording a stream.

This PR also adds the ID metadata to YouTube and Twitch.

The --title docs should ideally be rewritten and the available attributes moved to a different section. I will check this later today. After that I'd like to publish 3.0.2, because of the Twitch ads stuff.

@bastimeyer
Copy link
Member Author

bastimeyer commented Nov 23, 2021

Metadata tests/verifications:

YouTube (no category, even though the docs say so... needs to be fixed later)

$ streamlink --json 'youtube.com/hospitalrecords' best | jq .metadata
{
  "id": "Rf4jJzziJko",
  "author": "Hospital Records",
  "category": null,
  "title": "Drum & Bass Non-Stop Liquid - To Relax/Chill To"
}

Twitch stream

$ streamlink --json 'twitch.tv/esl_csgo' best | jq .metadata
{
  "id": "44540111069",
  "author": "ESL_CSGO",
  "category": "Counter-Strike: Global Offensive",
  "title": "LIVE: MAD Lions vs EC Brugge [Mirage] Map 1 - ESL Pro League Season 15 - Conference Stage - Day 1"
}

Twitch video

$ streamlink --json 'twitch.tv/videos/1213160751' best | jq .metadata
{
  "id": "1213160751",
  "author": "shroud",
  "category": "New World",
  "title": "DROPS ON. Shroudy - US West Celadon. G303 Shroud Edition."
}

Twitch clip

$ streamlink --json 'clips.twitch.tv/AltruisticTriangularVelociraptorHassaanChop-cFsTOgqHwvlvBb1i' best | jq .metadata
{
  "id": "1393769624",
  "author": "LIRIK",
  "category": "Battlefield 2042",
  "title": "Shroud and Lirik have never been in the same room"
}

@bastimeyer bastimeyer mentioned this pull request Nov 23, 2021
4 tasks
@bastimeyer
Copy link
Member Author

Merge conflicts solved after merging #4206.
As said, I'd like to rewrite the --title and metadata variables docs. I can only submit a PR once this gets merged, as I don't want to include the changes here.

- use factory function for metadata getters
- refactor clip API requests and split into two
- reorder return values in channel/video metadata requests
- update tests and add clip metadata tests
@bastimeyer
Copy link
Member Author

CI didn't run for some reason. Force-pushing again...

@back-to back-to merged commit 3309ed0 into streamlink:master Nov 24, 2021
@bastimeyer bastimeyer deleted the plugin/metadata-id branch November 24, 2021 17:43
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Nov 25, 2021
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Nov 25, 2021
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Nov 25, 2021
- use factory function for metadata getters
- refactor clip API requests and split into two
- reorder return values in channel/video metadata requests
- update tests and add clip metadata tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants