Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/playsuisse.py (Python)

Code before:
            'md5': 'eff6791c38784543f6d87a58bfe5de15',
            'info_dict': {
                'id': '817193',
                'ext': 'mp4',
                'title': 'Die Einweihungsparty',
                'series': 'Nr. 47',
                'season_number': 1,
                'episode': 'Die Einweihungsparty',
                'episode_number': 1,
                'description': 'md5:91ebf04d3a42cb3ab70666acf750a930'
            }
        }
    ]

    _GRAPHQL_QUERY = '''
        query AssetWatch($assetId: ID!) {
            asset(assetId: $assetId) {
                name
                description
                duration
                episodeNumber
                medias {
                    type
                    url
                }
                thumbnail16x9 {
                    ...ImageDetails
                }
                thumbnail2x3 {
                    ...ImageDetails
                }
                thumbnail16x9WithTitle {
                    ...ImageDetails
                }
                thumbnail2x3WithTitle {
                    ...ImageDetails
                }
            }
        }
        fragment ImageDetails on Image {
            id
            url
        }'''

    def _get_media_data(self, media_id):
        # NOTE In the web app, the "locale" header is used to switch between languages,
        # However this doesn't seem to take effect when passing the header here.
        response = self._download_json(
            'https://4bbepzm4ef.execute-api.eu-central-1.amazonaws.com/prod/graphql',
            media_id, data=json.dumps({
                'operationName': 'AssetWatch',

Review comment (suggestion):
```suggestion
    _NETRC_MACHINE = 'playsuisse'

```
We might want to add this to make it work with netrc.

Code after:
                'title': 'Der Läufer',
                'description': 'md5:9f61265c7e6dcc3e046137a792b275fd',
                'duration': 5280,
                'episode': 'Der Läufer',
                'thumbnail': 'md5:44af7d65ee02bbba4576b131868bb783'
            }
        },
        {
            'url': 'https://www.playsuisse.ch/watch/817193/0',
            'md5': '1d6c066f92cd7fffd8b28a53526d6b59',
            'info_dict': {
                'id': '817193',
                'ext': 'mp4',
                'title': 'Die Einweihungsparty',
                'description': 'md5:91ebf04d3a42cb3ab70666acf750a930',
                'duration': 1380,
                'series': 'Nr. 47',
                'season': 'Season 1',
                'season_number': 1,
                'episode': 'Die Einweihungsparty',
                'episode_number': 1,
                'thumbnail': 'md5:637585fb106e3a4bcd991958924c7e44'
            }
        }
    ]

    _GRAPHQL_QUERY = '''
        query AssetWatch($assetId: ID!) {
            assetV2(id: $assetId) {
                ...Asset
                episodes {
                    ...Asset
                }
            }
        }
        fragment Asset on AssetV2 {
            id
            name
            description
            duration
            episodeNumber
            seasonNumber
            seriesName
            medias {
                type
                url
            }
            thumbnail16x9 {
                ...ImageDetails
            }
            thumbnail2x3 {