documented the renderer section
This commit is contained in:
File diff suppressed because it is too large
Load Diff
8040
documentation/html/youtube-music/search/general-result.json
Normal file
8040
documentation/html/youtube-music/search/general-result.json
Normal file
File diff suppressed because it is too large
Load Diff
59
documentation/html/youtube-music/search/search.md
Normal file
59
documentation/html/youtube-music/search/search.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# Search
|
||||
|
||||
## Files
|
||||
|
||||
what is it | query | file
|
||||
---|---|---
|
||||
general search response | `psychonaut 4`, [general-result.json](general-result.json)
|
||||
|
||||
## A general search yields
|
||||
|
||||
- **Top Result**
|
||||
- The top Artist
|
||||
- The most popular songs of said artist
|
||||
- **Songs** (3) excluding the top songs
|
||||
- Videos (3)
|
||||
- **Albums** (3)
|
||||
- Community playlists (3)
|
||||
- **Artists** (3) excluding the top artist
|
||||
- if you search for a artist, it might return simmilar artists in style, not in name
|
||||
|
||||
### Different Renderers
|
||||
|
||||
#### `runs`
|
||||
|
||||
This should be pretty consistently all over the response be parsebal to a list of Music Elements.
|
||||
|
||||
`runs` usually is a list. If a element of the list has the key `navigationEndpoint`, it represents a music elements in a following manner:
|
||||
|
||||
- `text` the name
|
||||
- `navigationEndpoint` -> `browseEndpoint`
|
||||
- `browseId` the id of the artist/song/album...
|
||||
- `browseEndpointContextSupportedConfigs` -> `browseEndpointContextMusicConfig` -> `pageType` the type of the header like element
|
||||
|
||||
#### musicCardShelfRenderer
|
||||
|
||||
Used by e.g. the `Top Results`.
|
||||
|
||||
Contains:
|
||||
|
||||
- One Main-Element (a header like music object) | consists of these keys:
|
||||
- `thumbnail` the image of the header
|
||||
- `title` -> `runs`
|
||||
- for details look [here](#runs).
|
||||
|
||||
|
||||
### Details
|
||||
|
||||
You can get the contents (a list of [renderers](#musiccardshelfrenderer)) this way:
|
||||
|
||||
```python
|
||||
data = r.json().get("contents", {}).get("tabbedSearchResultsRenderer", {}).get("tabs", [{}])[0].get("tabRenderer").get("content", {}).get("sectionListRenderer", {}).get("contents", [])
|
||||
```
|
||||
|
||||
Then the list contains following items, in following order:
|
||||
|
||||
1. _About these results_ (an infobutton)
|
||||
2. The **Top result**
|
||||
3. The **Songs** [_musicShelfRenderer_]
|
||||
4. ...
|
Reference in New Issue
Block a user