Commit graph

731 commits

Author SHA1 Message Date
Solomon Victorino
59b3ca5643 search: fix episode parsing
- `parse_top_result`: handle episode data
- `parse_search_result`: ensure `resultType` is "episode", not "video"
- `parse_search_result`: offset runs to skip the "Episode" specifier
2025-07-28 18:17:13 +02:00
Solomon
39a480eace
prevent KeyError when parsing missing author data (#788)
`get_album` no longer errors on albums with no artist metadata, instead
returning `"artist": None`

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2025-07-24 21:31:49 +02:00
Haven Hamelin
ccd281ce29 Added a space between verification_url and comma
This fixes the situation in which the user ctrl + left clicks on the link in their terminal, and the comma is included as part of the code (which does not work).
2025-07-24 21:25:16 +02:00
sigma67
4506c7eb12 get_episode: fixed a crash for podcasts with missing description 2025-07-24 21:22:22 +02:00
Solomon Victorino
3f27d9bd07 update a couple tests
- replace deleted albums
- `MPREb_TPH4WqN5pUo`'s unavailable tracks are now in the tracklist
- handle podcast episodes in video results
2025-07-24 20:43:41 +02:00
sigma67
445833f420
Update bug_report.md 2025-05-22 21:18:37 +02:00
sigma67
459bc40e4c
Update README.rst 2025-04-27 09:53:40 +02:00
sigma67
14a575e168
fix typo 2025-04-17 16:38:36 +02:00
sigma67
eee75763b2
fix coverage.yml 2025-04-17 16:32:03 +02:00
sigma67
a979691bb0
>=3.10 strict typing (#765)
* >=3.10 

* fully typed (mypy strict mode enabled)

* fix tests (get_tasteprofile now requires auth - serverside)

* update linters

* fix uploads search
2025-04-17 16:05:34 +02:00
katia-sentry
03acc6ecff Enable basic Codecov Test Analytics with JUnit XML upload 2025-04-14 09:58:17 +02:00
sigma67
2bd7982a5d fix #758 2025-04-03 11:01:12 +02:00
Fabian Wunsch
f59a1b5dfd
Fix singles being renamed to "Singles & EPs" (#755)
* Fix singles being renamed to "Singles & EPs"

* add translation strings for "singles & eps"

* Remove old translation strings

---------

Co-authored-by: Solomon Victorino <git@solomonvictorino.com>
2025-03-31 22:18:14 +02:00
FireTime
e718643294
Update oauth.rst (#756)
missing parentheses
2025-03-30 19:53:05 +02:00
Stefano Borsatto
55b362e4dc
fix #751: parse_video returns always a video ID or None (#752) 2025-03-24 18:52:37 +01:00
sigma67
5e3bc62620
fix #743: get_album() now returns None for 'audioPlaylistId' (#744)
* fix #743: get_album() now returns None for 'audioPlaylistId'

* backwards compatibility
2025-03-05 21:48:06 +01:00
sigma67
c60950a2f4 simplified solution 2025-02-04 22:04:07 +01:00
Antonio Rojas
dfbcbcda7c Fix docs build
Make needs tabs, not spaces
2025-02-03 15:26:10 +01:00
sigma67
334798f68a
fix get_playlist continuations (#736)
* fix get_playlist continuations

* fix impl
2025-02-02 16:19:00 +01:00
sigma67
535f153f36
improve OAuthCredentials import ease of use (#732)
* improve OAuthCredentials import ease of use

* improve OAuthCredentials import ease of use
2025-01-31 16:14:06 +01:00
sigma67
a004bed436
refactor YTMusicBase, improve oauth doc (#727)
* refactor YTMusicBase, improve oauth doc

* fix recursion issue

* fix bugs, fix coverage, add session test
2025-01-19 14:37:31 +01:00
sigma67
af04fa4ac0
Fix 720 (#726)
* update dev-dependencies

* fix INP001

* rework docs (closes #720)

* update .readthedocs.yml
2025-01-17 20:17:04 +01:00
sigma67
e41e1a37d7
Fix 721 (#725)
* update dev-dependencies

* fix INP001

* fix #721

* add test

* format
2025-01-17 18:56:07 +01:00
sigma67
862f507e82 cli: add setup type, require version action 2025-01-17 08:56:14 +01:00
sigma67
452b5cdf6e
fix #713: get_artist radioId and shuffleId missing (#714)
* fix #713: get_artist radioId and shuffleId missing

* format
2025-01-08 08:48:07 +01:00
Solomon Victorino
3bd3da1bac get_playlist: support audio playlists 2024-12-28 23:09:26 +01:00
sigma67
e1ca551342
fix #703 (#704) 2024-12-27 20:02:16 +01:00
Solomon Victorino
338d63c9d7 search: exclude "Single"/"EP" text from album artist list
```diff
 next(r for r in yt.search("Eminem Houdini", filter="albums") if r["title"] == "Houdini")["artists"]

 [
-    {'name': 'Single', 'id': None},
     {'name': 'Eminem', 'id': 'UCedvOgsKFzcK3hA5taf3KoQ'}
 ]
```
2024-12-27 18:26:13 +01:00
Alex Pastel
4081404b56
fix(setup): Use resolve() before invoking as_uri() (#700)
If a relative file path is provided, `as_uri()` throws a ValueError.
Resolve the path to be absolute before converting to URI.
2024-12-27 18:15:58 +01:00
sigma67
0042e7d108 always upload coverage 2024-12-19 17:10:16 +01:00
sigma67
f7574237be add test analytics 2024-12-19 16:56:10 +01:00
sigma67
cdd4e38a57
update oauth docs and request interactive input instead of aborting (#694)
* update oauth docs and request interactive input instead of aborting

* move input inside oauth path, improve filename output

* update oauth.rst
2024-12-17 22:35:28 +01:00
sigma67
df1c3bdd5b feat: #670 get_podcast get_episode thumbnails 2024-12-17 22:23:29 +01:00
sigma67
b86654fbaf
Added Lyrics w. Timestamps #662 (#693)
* Added Lyrics w. Timestamps

Added `get_lyrics_with_timestamps` to get lyrics with timestamps.
The Method doesn't try to parse the response as normal lyrics, if no lyrics with timestamps are returned. (could be changed to do so tho, the format is the same)

* Update browsing.py

* Combined both get_lyrics methods into one and fixed some typechecking errors

* Fixed a missing hasTimestamps and added the doccomments to the overloads, because vscode didn't show them otherwise

* Removed the old get_lyrics_with_timestamps method

because idk where it came from...

* fixed remaining issues

* Update uploads.py

reverted some changes that I moved to an extra PR

* removed variable `context` from the Mixin, as it's use was replaced by `yt.as_mobile()`

* fix some formatting complaints by ruff and mypy

* please the linter

* fix union syntax

* improve typing in ytmusic.py

* improve typing

* replace docsbuild.yml with RTD

---------

Co-authored-by: Hendrik Horstmann <65970327+heinrich26@users.noreply.github.com>
Co-authored-by: henrich26 <hendrik-horstmann@o2mail.de>
2024-12-17 22:12:06 +01:00
Hendrik Horstmann
bb4bf4d3e1
Docstring cleanup (#665)
* Cleaned up docstrings

* cleaned up more

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-12-17 21:35:44 +01:00
Solomon
74411149d4
get_playlist: join multiple title runs (#667)
* Return complete titles when split on time-like strings:

```diff
>>> yt.get_playlist("PLaZPMsuQNCsWn0iVMtGbaUXO6z-EdZaZm")["title"]
-03 Jan
+03 Jan 12:09
```

* `test_get_playlist`: assert more props have the expected value/shape

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-12-17 21:20:33 +01:00
Corentin Marquet
1f14332eb4
search: adds functionality to remove search suggestion (#678)
* search: adds functionality to remove search history suggestion

* Minor improvements for remove search suggestions

* fix lint

* some improvements: remove_search_suggestions

* make indices optional

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-12-17 20:01:11 +01:00
sigma67
db732f29b9 fix #675 2024-12-17 18:28:14 +01:00
fischcode
fe95f5974e
Add optional parameters for OAuth client ID and secret to setup (#688)
* Add optional parameters for OAuth client ID and secret to setup

Use your own Google API client ID and client secret in setup by calling
ytmusicapi oauth --client_id <your Google API client ID> --client_secret <your Google API client secret> to avoid HTTP 400: Bad Request errors

* Improve setup parameter parsing and help texts

- Add subparsers for parameters for oauth and browser tokens
- Add help options
- Add a check for presence of both client_id and client_secret if oauth is chosen.

* ruff autofix

* wip: remove default oauth_client_id & secret, turn into mandatory params

* fix yt_oauth fixture

* fix format/lint

* fix cli args and oauth test

* remove skip

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-12-17 13:15:33 +01:00
sigma67
7ef703c213
Fix get_history (#691)
* fix get_history feedbackToken parsing

* remove broken playlist test

* skip broken tests for now
2024-12-17 12:21:04 +01:00
github-actions[bot]
160d2664c8
chore: Update pdm.lock (#636)
* chore: Update pdm.lock

* bump lock and actions

---------

Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com>
Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-12-16 22:38:03 +01:00
Luis Ignacio
0d39603ba5 refactor: simplify songlist parsing in LibraryMixin 2024-12-14 10:29:45 +01:00
sigma67
9ce284a7ea
Update README.rst 2024-10-22 08:20:40 +02:00
Abhishek M J
8f479b1b5b
Fix duration parsing for very long videos (#661)
* Fix duration parsing for very long videos sigma67#660

* parse duration only when digits are present

* explicit return None

* Add test for track dur > 1k hrs
2024-10-15 16:58:31 +02:00
fritz stelluto
2b5d19abb1
fix #656: attempt to find runs in subtitle if not in title (#657)
* fix #656: attempt to find runs in subtitle if not in title

* refactor

* remove fix by gotofritz

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-10-08 12:17:14 +02:00
sigma67
2c6c6b6504
search: fix missing playlistId for album results while authenticated (#659)
* search: fix missing playlistId for album results while authenticated

* deduplicate test
2024-10-07 20:28:56 +02:00
sigma67
e995ae56ce
search: fix missing artists when filtering songs/videos (#655)
* search: fix missing artists when filtering songs/videos

* search: fix missing artists when filtering songs/videos
2024-10-05 13:30:18 +02:00
sigma67
77e40b7f7d
refactor: use pathlib (#654)
* refactor: use pathlib

* fix size mock
2024-10-05 12:39:21 +02:00
sigma67
7d8a756638
upload_song: add error when file exceeds limit of 300MB (#653)
* upload_song: add error when file exceeds limit of 300MB (closes #647)

* fix import
2024-10-05 11:40:51 +02:00
sigma67
09ca398719
fix #642: create_playlist: raise error when invalid characters are pa… (#652)
* fix #642: create_playlist: raise error when invalid characters are part of playlist title

* add test

* fix CI helper

* fix CI helper

* adjust workflow
2024-10-05 11:31:11 +02:00