Skip to content

Conversation

@back-to
Copy link
Collaborator

@back-to back-to commented Nov 6, 2021

  • can be used for Authorization or other headers
  • change PlaybackAccessToken playerType to site as embed will show ads
  • remove some unsed HLS and headers code

streamlink https://twitch.tv/twitch best \
    --twitch-api-header "X-Device-Id=twitch-web-wall-mason" \
    --twitch-api-header "Device-Id=twitch-web-wall-mason"

closes #4080

@back-to back-to added the plugin enhancement A new feature for a working Plugin label Nov 6, 2021
Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's GQL (Graph Query Language), not GPL.

Adding a generic parameter for adjusting the API requests headers makes more sense than adding multiple ones for specific authentication/identification methods, so I'm in favor of that. The problem here though is that it's not particularly user-friendly, but neither is extracting headers from the web browser, so it's fine.

@bastimeyer
Copy link
Member

It might be better to just call it twitch-api-header. This is less confusing, people don't have to memorize specific names (gql) and it's shorter (no http-).

- allow user header for api http requests
- can be used for `Authorization` or other headers
- change PlaybackAccessToken playerType to `site` as `embed` will show ads
- remove some unsed HLS and headers code

---

```
streamlink https://twitch.tv/twitch best \
    --twitch-api-header "X-Device-Id=twitch-web-wall-mason" \
    --twitch-api-header "Device-Id=twitch-web-wall-mason"
```
@back-to back-to changed the title plugins.twitch: allow user headers for gpl api plugins.twitch: new plugin command --twitch-api-header Nov 6, 2021
@bastimeyer
Copy link
Member

playerType="site" also causes (preroll-)ads. There's no difference. Did you get midroll ads with embed or why did you change it?

@back-to
Copy link
Collaborator Author

back-to commented Nov 6, 2021

server_ads will be False with site but True with embed

[plugins.twitch][debug] {'adblock': False, 'geoblock_reason': '', 'hide_ads': False, 'server_ads': False, 'show_ads': True}

when used with

streamlink https://twitch.tv/twitch best \
    --twitch-api-header "X-Device-Id=twitch-web-wall-mason" \
    --twitch-api-header "Device-Id=twitch-web-wall-mason"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin enhancement A new feature for a working Plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants