flacfetch 0.35.0__tar.gz → 0.35.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. {flacfetch-0.35.0/flacfetch.egg-info → flacfetch-0.35.1}/PKG-INFO +1 -1
  2. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/providers/youtube.py +5 -3
  3. {flacfetch-0.35.0 → flacfetch-0.35.1/flacfetch.egg-info}/PKG-INFO +1 -1
  4. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch.egg-info/SOURCES.txt +2 -1
  5. {flacfetch-0.35.0 → flacfetch-0.35.1}/pyproject.toml +1 -1
  6. flacfetch-0.35.1/tests/test_youtube_provider.py +32 -0
  7. {flacfetch-0.35.0 → flacfetch-0.35.1}/ARCHITECTURE.md +0 -0
  8. {flacfetch-0.35.0 → flacfetch-0.35.1}/LICENSE +0 -0
  9. {flacfetch-0.35.0 → flacfetch-0.35.1}/MANIFEST.in +0 -0
  10. {flacfetch-0.35.0 → flacfetch-0.35.1}/PLAN.md +0 -0
  11. {flacfetch-0.35.0 → flacfetch-0.35.1}/README.md +0 -0
  12. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/__init__.py +0 -0
  13. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/__init__.py +0 -0
  14. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/auth.py +0 -0
  15. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/main.py +0 -0
  16. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/models.py +0 -0
  17. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/__init__.py +0 -0
  18. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/cache.py +0 -0
  19. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/config.py +0 -0
  20. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/credentials.py +0 -0
  21. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/download.py +0 -0
  22. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/health.py +0 -0
  23. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/search.py +0 -0
  24. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/spotify.py +0 -0
  25. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/routes/torrents.py +0 -0
  26. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/__init__.py +0 -0
  27. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/credential_check.py +0 -0
  28. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/disk_manager.py +0 -0
  29. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/download_manager.py +0 -0
  30. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/health_check.py +0 -0
  31. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/search_cache.py +0 -0
  32. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/secret_manager_utils.py +0 -0
  33. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/api/services/spotify_budget.py +0 -0
  34. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/album_match.py +0 -0
  35. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/categorize.py +0 -0
  36. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/config.py +0 -0
  37. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/interfaces.py +0 -0
  38. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/log.py +0 -0
  39. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/manager.py +0 -0
  40. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/matching.py +0 -0
  41. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/core/models.py +0 -0
  42. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/__init__.py +0 -0
  43. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/__main__.py +0 -0
  44. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/browser.py +0 -0
  45. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/google_login.py +0 -0
  46. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/keeper.py +0 -0
  47. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/librespot.py +0 -0
  48. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/probe.py +0 -0
  49. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/spotify.py +0 -0
  50. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/credential_keeper/youtube.py +0 -0
  51. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/downloaders/spotify.py +0 -0
  52. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/downloaders/torrent.py +0 -0
  53. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/downloaders/torrent_coordinator.py +0 -0
  54. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/downloaders/youtube.py +0 -0
  55. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/interface/cli.py +0 -0
  56. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/interface/cli_remote.py +0 -0
  57. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/providers/gazelle.py +0 -0
  58. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/providers/ops.py +0 -0
  59. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/providers/red.py +0 -0
  60. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch/providers/spotify.py +0 -0
  61. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch.egg-info/dependency_links.txt +0 -0
  62. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch.egg-info/entry_points.txt +0 -0
  63. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch.egg-info/requires.txt +0 -0
  64. {flacfetch-0.35.0 → flacfetch-0.35.1}/flacfetch.egg-info/top_level.txt +0 -0
  65. {flacfetch-0.35.0 → flacfetch-0.35.1}/requirements.txt +0 -0
  66. {flacfetch-0.35.0 → flacfetch-0.35.1}/setup.cfg +0 -0
  67. {flacfetch-0.35.0 → flacfetch-0.35.1}/setup.py +0 -0
  68. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/_route_paths.py +0 -0
  69. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_album_search.py +0 -0
  70. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_auth.py +0 -0
  71. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_config.py +0 -0
  72. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_deep_health.py +0 -0
  73. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_health_ytdlp.py +0 -0
  74. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_integration.py +0 -0
  75. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_models.py +0 -0
  76. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_routes.py +0 -0
  77. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_api_services.py +0 -0
  78. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_cache_api.py +0 -0
  79. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_cli_cookies.py +0 -0
  80. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_cli_remote.py +0 -0
  81. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_core.py +0 -0
  82. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_credential_keeper.py +0 -0
  83. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_gazelle.py +0 -0
  84. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_keeper_probe.py +0 -0
  85. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_logging.py +0 -0
  86. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_manager.py +0 -0
  87. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_matching.py +0 -0
  88. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_models.py +0 -0
  89. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_ops.py +0 -0
  90. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_provider_errors.py +0 -0
  91. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_red.py +0 -0
  92. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_search_api.py +0 -0
  93. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_spotify.py +0 -0
  94. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_spotify_budget.py +0 -0
  95. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_torrent_coordinator.py +0 -0
  96. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_torrent_downloader.py +0 -0
  97. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_torrent_shared_album.py +0 -0
  98. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_transcode_hf_noise.py +0 -0
  99. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_youtube.py +0 -0
  100. {flacfetch-0.35.0 → flacfetch-0.35.1}/tests/test_youtube_cookies.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flacfetch
3
- Version: 0.35.0
3
+ Version: 0.35.1
4
4
  Summary: Search and download high-quality audio from multiple sources
5
5
  Home-page: https://github.com/yourusername/flacfetch
6
6
  Author: Your Name
@@ -29,9 +29,11 @@ class YoutubeProvider(Provider):
29
29
  return "YouTube"
30
30
 
31
31
  def search(self, query: TrackQuery) -> list[Release]:
32
- # Search for 5 results
33
- # Adding "topic" often helps find the auto-generated "Topic" channel results which are high quality audio
34
- search_query = f"ytsearch5:{query.artist} {query.title} topic"
32
+ # Search for 5 results. Keep the query plain: a " topic" suffix (meant to
33
+ # surface auto-generated Topic channel audio) pushed the actual song out of
34
+ # the top 5 entirely for lesser-known tracks (Playa Fly - N God We Trust).
35
+ # select_best() still prefers Topic/official uploads when they do appear.
36
+ search_query = f"ytsearch5:{query.artist} {query.title}"
35
37
 
36
38
  # Get base options (includes cookies if available)
37
39
  ydl_opts = get_ytdlp_base_opts(self.cookies_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flacfetch
3
- Version: 0.35.0
3
+ Version: 0.35.1
4
4
  Summary: Search and download high-quality audio from multiple sources
5
5
  Home-page: https://github.com/yourusername/flacfetch
6
6
  Author: Your Name
@@ -94,4 +94,5 @@ tests/test_torrent_downloader.py
94
94
  tests/test_torrent_shared_album.py
95
95
  tests/test_transcode_hf_noise.py
96
96
  tests/test_youtube.py
97
- tests/test_youtube_cookies.py
97
+ tests/test_youtube_cookies.py
98
+ tests/test_youtube_provider.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "flacfetch"
7
- version = "0.35.0"
7
+ version = "0.35.1"
8
8
  description = "Search and download high-quality audio from multiple sources"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10,<4.0"
@@ -0,0 +1,32 @@
1
+ """Tests for the YouTube search provider's query construction."""
2
+ from contextlib import contextmanager
3
+ from unittest.mock import MagicMock, patch
4
+
5
+ from flacfetch.core.models import TrackQuery
6
+ from flacfetch.providers.youtube import YoutubeProvider
7
+
8
+
9
+ def _search_and_capture_query(artist: str, title: str) -> str:
10
+ ydl = MagicMock()
11
+ ydl.extract_info.return_value = {"entries": []}
12
+ ydl_cm = MagicMock()
13
+ ydl_cm.__enter__.return_value = ydl
14
+
15
+ @contextmanager
16
+ def fake_isolated(opts):
17
+ yield opts
18
+
19
+ with patch("flacfetch.providers.youtube.get_ytdlp_base_opts", return_value={}), \
20
+ patch("flacfetch.providers.youtube.ytdlp_opts_isolated", fake_isolated), \
21
+ patch("flacfetch.providers.youtube.yt_dlp.YoutubeDL", return_value=ydl_cm):
22
+ YoutubeProvider().search(TrackQuery(artist=artist, title=title))
23
+
24
+ return ydl.extract_info.call_args.args[0]
25
+
26
+
27
+ def test_search_query_is_plain_artist_title():
28
+ """A ' topic' suffix pushed the actual song out of the results
29
+ (Playa Fly - N God We Trust), so the query must be just artist + title."""
30
+ query = _search_and_capture_query("Playa Fly", "N God We Trust")
31
+ assert query == "ytsearch5:Playa Fly N God We Trust"
32
+ assert "topic" not in query.lower()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes