Commit graph ytmusicapi/tests
Author SHA1 Message Date
sigma67
14ae7852ea
coverage: remove code for old playlist format (#619)
* coverage: remove temporary code for new playlist format

* fix flaky search test

* improve rate_song coverage

* test invalid order raise

* fix workflow
2024-07-13 21:18:19 +02:00
sigma67
828b1b9810
drop 3.8, add pytest-retry (#592)
* drop 3.8, add pytest-retry

* fix mypy

* fix missing import
2024-07-13 20:40:50 +02:00
JohnHKoh
08d9f3049c
Extract song count from text (#609)
* Extract song count from text

* Add fix in parsers

* add test

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-07-13 20:28:00 +02:00
sigma67
05cb3caf4a
fix some more tests 2024-07-03 22:05:50 +02:00
sigma67
c97a13e3bd
fix search test 2024-07-03 21:50:32 +02:00
Ricardo Mendonça Ferreira
11823d6387
edit_playlist(): Allow moving title to bottom of playlist (#602)
* Allow moving title to bottom of playlist

* test_edit_playlist fixed & extended

* add labeled coverage workflow run for external PRs

* add labeled coverage workflow run for external PRs

* add labeled coverage workflow run for external PRs

* add another pr target workflow

---------

Co-authored-by: Ricardo <ric.ce.br@gmail.com>
Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-06-17 18:24:39 +02:00
sigma67
0cf0883723
fix #582 (#583)
* fix #582

* fix result type heuristics
2024-05-20 21:45:02 +02:00
Alex Pastel
ae966bb96a
Gracefully retrieve uploaded songs with a blank duration (#578) (#580)
* add unit test that attempts to retrieve a song after its been uploaded

* prevent parsing errors when an uploaded song lacks a duration

* update unit test to delete/re-upload song if it already is uploaded

* format

* fix test

* add another sleep to end2end playlist

---------

Co-authored-by: sigma67 <ytmusicapi@gmail.com>
2024-05-11 18:23:11 +02:00
sigma67
614999c77d
search: fix #569 (#581)
* search: fix #569

* fix an issue with localized instances

* add test for localized search
2024-05-09 21:23:19 +02:00
sigma67
f53074e5f2
fix #562 (#573)
* fix #562

* fix test

* use correct public test data

* fix up for new format

* fix lint
2024-05-04 13:19:53 +02:00
sigma67
2217f3d92d
fix #544 (#560)
* fix #544

* fix ignores
2024-04-05 20:53:32 +02:00
sigma67
0d996030f4 get_artist: shows support 2024-03-13 20:53:08 +01:00
sigma67
f6932c2bf1
get_episodes_playlist (#561)
* get_episodes_playlist

* fix minor issues
2024-03-08 21:32:09 +01:00
sigma67
90d172b1d3
podcasts features ✨ (#559) 2024-03-06 23:02:19 +01:00
Alex Pastel
c412d7ce34
Implement get_account_info() to get authenticated user's account info (#556) (#557)
* implement get_account_info to provide information about the authenticated user's account (#556)

* Apply suggestions from code review to tests/README.rst

Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com>

* simplify get_account_info by moving code out of parsers.py and navigation.py

* test with non-auth account

* format

* update .pre-commit-config.yaml

---------

Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com>
Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-03-03 19:55:06 +01:00
sigma67
0734595395 get_episode: support progress percentage 2024-03-01 20:49:11 +01:00
fischcode
d143480ae4
Fix parsing of album and views in parse_playlist_items (#552)
* Fix parsing of album and views in parse_playlist_items

Parse album and views columns as a function of flex column count and is_album property to cater for varying layouts with three and four flex columns

* Add "own_playlist" attribute to playlists

To allow for an easy distinction between owned / editable and community / non-editable playlists,in applications incorporating ytmusicapi, a boolean "own_playlist" dictionary entry is added to playlists based on existing code already identifying this property.

* Add thumbnails to episodes

Add thumbnails to episodes for visual rendering in Kodi etc.

* Add unit test for playlist "own_playlist" attribut

Add unit test for playlist "own_playlist" attribut

* Improvements as requested

- rename attribute for own playlists to playlist("owned")
- filter out episode thumbnails with an non-functional URL

* Fix linter in test_playlists.py

Fix test for playlist["owned"]

* Auto-Formatting on playlists.py

* format parsers/podcasts.py

* Remove filtering of podcast thumbnails

No idea why I had seen useless images for those thumbnails before - maybe Google fixed something to make them work?
2024-02-27 09:23:09 +01:00
sigma67
f237d50ab7 fix tests 2024-02-22 20:47:15 +01:00
sigma67
e1bcb88c92 Revert "get_charts: removed trending category (no longer available on YTM)"
This reverts commit da492e49f6.
2024-02-22 20:47:15 +01:00
sigma67
f98274f0ec improve coverage 2024-02-04 17:03:59 +01:00
sigma67
da492e49f6 get_charts: removed trending category (no longer available on YTM) 2024-02-04 17:03:59 +01:00
sigma67
cc26a63264 get_watch_playlist: fixed an issue when longBylineText is missing 2024-02-04 17:03:59 +01:00
sigma67
170eea358d add brand account setup script (#520) 2024-02-04 17:03:59 +01:00
sigma67
47b27f0f0e
get_podcast, get_episode: improve edge cases 2024-01-22 23:06:22 +01:00
John Birdwell
123eae7370
get_album: parse more data from response + correct keys on other_vers… (#523)
* get_album: parse more data from response + correct keys on other_versions

* keys: fair point

* navigation, browsing: removed duplicate SUBTITLE

---------

Co-authored-by: sigma67 <ytmusicapi@gmail.com>
2024-01-21 19:39:52 +01:00
fischcode
de651c40eb
handle playlists appearing in top results (closes #524) (#526)
* handle playlists appearing in top results #524

parse playlists appearing in top results returning results the same way as for other playlists found be search()

* fixup, add test

---------

Co-authored-by: sigma67 <ytmusicapi@gmail.com>
2024-01-21 19:06:38 +01:00
sigma67
bb7a51e496 get_saved_episodes 2024-01-21 18:43:27 +01:00
sigma67
a3e4c26c8a get_podcast, get_episode 2024-01-21 18:43:27 +01:00
sigma67
650bc24d68 get_album: rename track_number to trackNumber 2024-01-21 18:43:27 +01:00
sigma67
9170197457
ruff: ruff specific rules 2024-01-18 21:53:23 +01:00
sigma67
b87c783d45
ruff: pyupgrade 2024-01-18 21:48:04 +01:00
John Birdwell
2b42c58963
get_album: track_number returns none when track unavailable + test (#516)
* get_album: track_number returns none when track unavailable + test

* Update ytmusicapi/parsers/playlists.py

Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com>

* test_get_album: sans fixtures

---------

Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com>
2024-01-14 14:38:29 +01:00
sigma67
ff51a5bb40
fix flaky test 2024-01-11 20:37:30 +01:00
John Birdwell
ba71fc998d
get_album: track positions (#510)
* get_album (via parse_playlist_items): add track_position key + tests for the badly indexed album

* get_album & parse_playlist_items: nav changes

* parse_playlist_items: only add track_position for albums

* parse_playlist_items & related test_browsing: track_position > track_number

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
2024-01-11 20:02:23 +01:00
sigma67
b094345e44
add test for order exception 2024-01-10 21:22:21 +01:00
sigma67
e864a6be53 get_artist_albums: add order param (#441) 2024-01-10 21:19:59 +01:00
sigma67
f2be19416b get_artist_albums: support continuations (#441) 2024-01-10 21:19:59 +01:00
sigma67
9506bfd6d5
fix #501 (#502)
* fix #501

* enable tests on PR
2024-01-03 21:15:00 +01:00
sigma67
d4bea93414
improve coverage 2024-01-02 22:29:41 +01:00
sigma67
69dd4a9f2f test restructuring via pytest 2024-01-02 22:09:22 +01:00
sigma67
e0d73c02b2
fix tests 2024-01-01 14:27:20 +01:00
sigma67
e88792b452
remove flaky assert 2023-12-31 20:25:17 +01:00
sigma67
70a260b516 add mypy 2023-12-31 20:13:45 +01:00
sigma67
f3e747103f
get_album: return new "views" key for each track 2023-12-31 14:39:05 +01:00
John Birdwell
1971121add
Search issue 494 (#495)
* search_suggestions: fix handle history when authenticated

* search_suggestions: test historical option does something

* remove optional param

---------

Co-authored-by: sigma67 <ytmusicapi@gmail.com>
2023-12-31 13:16:48 +01:00
sigma67
1fd93dcfb6
Ruff lint (#496)
* add ruff, pdm

* update .gitignore

* format

* test

* check failure

* fix constants.py
2023-12-31 12:54:07 +01:00
sigma67
c848e50b3b
refactor authtypes 2023-12-31 11:18:39 +01:00
jcbirdwell
a6ae5add7f tests: further edits for clarity and oauth tests 2023-12-28 18:23:51 -06:00
jcbirdwell
7b60e65ea4 test_get_album_browse_id: hindsight test edit and bulletproof fix for warning 2023-12-28 17:58:39 -06:00
jcbirdwell
814ea9999b get_album_browse_id: reverted and subtest added for edge case 2023-12-20 15:15:25 -06:00