File: faq.rst

package info (click to toggle)
python-ytmusicapi 1.10.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,412 kB
  • sloc: python: 4,324; sh: 14; makefile: 12
file content (428 lines) | stat: -rw-r--r-- 11,475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
FAQ
=====

Frequently asked questions for ``ytmusicapi``. Contributions are welcome, please
`submit a PR <https://github.com/sigma67/ytmusicapi/pulls>`_.

Setup
------------

My library results are empty even though I set up my cookie correctly.
***********************************************************************
Please make sure that you don't have multiple Google accounts. ``ytmusicapi`` might be returning
results from a different account which is currently empty. You can set your account using ``X-Goog-AuthUser``
in your headers file (numeric index) or by providing the id of a brand account with ``ytmusic = YTMusic(headers, "1234..")``.
For more details see the :doc:`reference/index`.

Usage
-----------------------

How do I add content to my library?
***********************************************************************
- **songs**: `edit_song_library_status <reference.html#ytmusicapi.YTMusic.edit_song_library_status>`__ .
  Liking a song using `rate_song <reference.html#ytmusicapi.YTMusic.rate_song>`__
  does *not* add it to your library, only to your liked songs playlist.
- **albums, playlists**: `rate_playlist <reference.html#ytmusicapi.YTMusic.rate_playlist>`__
- **artists**: `subscribe_artists <reference.html#ytmusicapi.YTMusic.subscribe_artists>`__ .
  This will add the artist to your Subscriptions tab. The Artists tab is determined by the songs/albums you have
  added to your library.
- **podcasts**: `rate_playlist <reference.html#ytmusicapi.YTMusic.rate_playlist>`__
- **episodes**: `add_playlist_items("SE", episode_id) <reference.html#ytmusicapi.YTMusic.add_playlist_items>`__



How can I get the radio playlist for a song, video, playlist or album?
***********************************************************************
- **songs, videos**: ``RDAMVM`` + ``videoId``
- **playlists, albums**: ``RDAMPL`` + ``playlistId``

See also `What is a browseId <faq.html#what-is-a-browseid>`__ below.


How can I get the shuffle playlist for a playlist or album?
***********************************************************************
Use `get_watch_playlist_shuffle <reference.html#ytmusicapi.YTMusic.get_watch_playlist_shuffle>`__
with the ``playlistId`` or ``audioPlaylistId`` (albums).

How can I get all my public playlists in a single request?
***********************************************************************
Call `get_user_playlists <reference.html#ytmusicapi.YTMusic.get_user_playlists>`__
with your own ``channelId``.

Can I download songs?
***********************************************************************
You can use `youtube-dl <https://github.com/ytdl-org/youtube-dl/>`_ for this purpose.

How do I package ytmusicapi with ``pyinstaller``?
*************************************************

To package ytmusicapi correctly, you need to add the locales files to your executable.

You can use ``--add-data path-to-ytmusicapi/locales`` or ``--collect-all ytmusicapi`` to accomplish this.


YouTube Music API Internals
------------------------------

Is there a difference between songs and videos?
***********************************************************************
Yes. Videos are regular videos from YouTube, which can be uploaded by any user. Songs are actual songs uploaded by artists.

You can also add songs to your library, while you can't add videos.

Is there a rate limit?
***********************************************************************
There most certainly is, although you shouldn't run into it during normal usage.
See related issues:

- `Creating playlists <https://github.com/sigma67/ytmusicapi/issues/19>`_
- `Uploads <https://github.com/sigma67/ytmusicapi/issues/6>`_


What is a browseId?
***********************************************************************
A ``browseId`` is an internal, globally unique identifier used by YouTube Music for browsable content.

In most cases you can compose it yourself:

+--------+------------+----------------------+
| Prefix | Main       | Content              |
+========+============+======================+
| VM     | playlistId | Playlist             |
+--------+------------+----------------------+
| RDAMVM | playlistId | Video-based Radio    |
+--------+------------+----------------------+
| RDAMPL | videoId    | Playlist-based Radio |
+--------+------------+----------------------+
| MPLA   | channelId  | Artist               |
+--------+------------+----------------------+
| MPRE   | custom     | Album                |
+--------+------------+----------------------+
| MPSP   | playlistId | Podcast              |
+--------+------------+----------------------+
| MPED   | videoId    | Episode              |
+--------+------------+----------------------+


Which videoTypes exist and what do they mean?
***********************************************************************

``videoType`` is prefixed with ``MUSIC_VIDEO_TYPE_``, i.e. ``MUSIC_VIDEO_TYPE_OMV``.
Currently the following variants of ``videoType`` are known:

- ``OMV``: Original Music Video - uploaded by original artist with actual video content
- ``UGC``: User Generated Content - uploaded by regular YouTube user
- ``ATV``: High quality song uploaded by original artist with cover image
- ``OFFICIAL_SOURCE_MUSIC``: Official video content, but not for a single track


Why is ytmusicapi returning more results than requested with the limit parameter?
*********************************************************************************
YouTube Music always returns increments of a specific pagination value, usually between 20 and 100 items at a time.
This is the case if a ytmusicapi method supports the ``limit`` parameter. The default value of the ``limit`` parameter
indicates the server-side pagination increment. ytmusicapi will keep fetching continuations from the server until it has
reached at least the ``limit`` parameter, and return all of these results.


Which values can I use for languages?
*************************************

The ``language`` parameter determines the language of the returned results.
``ytmusicapi`` only supports a subset of the languages supported by YouTube Music, as translations need to be done manually.
Contributions are welcome, see `here for instructions <https://github.com/sigma67/ytmusicapi/tree/master/ytmusicapi/locales>`__.

For the list of values you can use for the ``language`` parameter, see below:

.. raw:: html

   <details>
   <br>
   <summary><a>Supported locations</a></summary>

.. container::

    .. list-table::

        * - **Language**
          - **Value**
        * - Arabic
          - ar
        * - German
          - de
        * - English (default)
          - en
        * - Spanish
          - es
        * - French
          - fr
        * - Hindi
          - hi
        * - Italian
          - it
        * - Japanese
          - ja
        * - Korean
          - ko
        * - Dutch
          - nl
        * - Portuguese
          - pt
        * - Russian
          - ru
        * - Turkish
          - tr
        * - Urdu
          - ur
        * - Chinese (Mainland)
          - zh_CN
        * - Chinese (Taiwan)
          - zh_TW


.. raw:: html

   </details>
   </br>



Which values can I use for locations?
*************************************

Pick a value from the list below for your desired location and pass it using the ``location`` parameter.

.. raw:: html

   <details>
   <br>
   <summary><a>Supported locations</a></summary>

.. container::

    .. list-table::

        * - **Location**
          - **Value**
        * - Algeria
          - DZ
        * - Argentina
          - AR
        * - Australia
          - AU
        * - Austria
          - AT
        * - Azerbaijan
          - AZ
        * - Bahrain
          - BH
        * - Bangladesh
          - BD
        * - Belarus
          - BY
        * - Belgium
          - BE
        * - Bolivia
          - BO
        * - Bosnia and Herzegovina
          - BA
        * - Brazil
          - BR
        * - Bulgaria
          - BG
        * - Cambodia
          - KH
        * - Canada
          - CA
        * - Chile
          - CL
        * - Colombia
          - CO
        * - Costa Rica
          - CR
        * - Croatia
          - HR
        * - Cyprus
          - CY
        * - Czechia
          - CZ
        * - Denmark
          - DK
        * - Dominican Republic
          - DO
        * - Ecuador
          - EC
        * - Egypt
          - EG
        * - El Salvador
          - SV
        * - Estonia
          - EE
        * - Finland
          - FI
        * - France
          - FR
        * - Georgia
          - GE
        * - Germany
          - DE
        * - Ghana
          - GH
        * - Greece
          - GR
        * - Guatemala
          - GT
        * - Honduras
          - HN
        * - Hong Kong
          - HK
        * - Hungary
          - HU
        * - Iceland
          - IS
        * - India
          - IN
        * - Indonesia
          - ID
        * - Iraq
          - IQ
        * - Ireland
          - IE
        * - Israel
          - IL
        * - Italy
          - IT
        * - Jamaica
          - JM
        * - Japan
          - JP
        * - Jordan
          - JO
        * - Kazakhstan
          - KZ
        * - Kenya
          - KE
        * - Kuwait
          - KW
        * - Laos
          - LA
        * - Latvia
          - LV
        * - Lebanon
          - LB
        * - Libya
          - LY
        * - Liechtenstein
          - LI
        * - Lithuania
          - LT
        * - Luxembourg
          - LU
        * - Malaysia
          - MY
        * - Malta
          - MT
        * - Mexico
          - MX
        * - Montenegro
          - ME
        * - Morocco
          - MA
        * - Nepal
          - NP
        * - Netherlands
          - NL
        * - New Zealand
          - NZ
        * - Nicaragua
          - NI
        * - Nigeria
          - NG
        * - North Macedonia
          - MK
        * - Norway
          - NO
        * - Oman
          - OM
        * - Pakistan
          - PK
        * - Panama
          - PA
        * - Papua New Guinea
          - PG
        * - Paraguay
          - PY
        * - Peru
          - PE
        * - Philippines
          - PH
        * - Poland
          - PL
        * - Portugal
          - PT
        * - Puerto Rico
          - PR
        * - Qatar
          - QA
        * - Romania
          - RO
        * - Russia
          - RU
        * - Saudi Arabia
          - SA
        * - Senegal
          - SN
        * - Serbia
          - RS
        * - Singapore
          - SG
        * - Slovakia
          - SK
        * - Slovenia
          - SI
        * - South Africa
          - ZA
        * - South Korea
          - KR
        * - Spain
          - ES
        * - Sri Lanka
          - LK
        * - Sweden
          - SE
        * - Switzerland
          - CH
        * - Taiwan
          - TW
        * - Tanzania
          - TZ
        * - Thailand
          - TH
        * - Tunisia
          - TN
        * - Turkey
          - TR
        * - Uganda
          - UG
        * - Ukraine
          - UA
        * - United Arab Emirates
          - AE
        * - United Kingdom
          - GB
        * - United States
          - US
        * - Uruguay
          - UY
        * - Venezuela
          - VE
        * - Vietnam
          - VN
        * - Yemen
          - YE
        * - Zimbabwe
          - ZW

.. raw:: html

   </details>
   </br>