nuke artist
This commit is contained in:
parent
34571d6fd2
commit
41293eb58c
6 changed files with 13 additions and 82 deletions
|
|
@ -28,51 +28,6 @@ class YoutubeVideoVariables(EntryVariables):
|
||||||
"""
|
"""
|
||||||
return sanitize_filename(self.channel)
|
return sanitize_filename(self.channel)
|
||||||
|
|
||||||
@property
|
|
||||||
def track_title(self: BaseEntry) -> str:
|
|
||||||
"""
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
str
|
|
||||||
The track title of a music video if it is available, otherwise it falls back to the
|
|
||||||
title. NOTE: Even if a video has music metadata, this variable does not always get
|
|
||||||
pulled via yt-dlp. Use with caution.
|
|
||||||
"""
|
|
||||||
# Try to get the track, fall back on title
|
|
||||||
return self.kwargs_get("track", super().title)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def track_title_sanitized(self) -> str:
|
|
||||||
"""
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
str
|
|
||||||
The sanitized track title.
|
|
||||||
"""
|
|
||||||
return sanitize_filename(self.track_title)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def artist(self: BaseEntry) -> str:
|
|
||||||
"""
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
str
|
|
||||||
The artist of a music video if it is available, otherwise it falls back to the channel.
|
|
||||||
NOTE: Even if a video has music metadata, this variable does not always get pulled via
|
|
||||||
yt-dlp. Use with caution.
|
|
||||||
"""
|
|
||||||
return self.kwargs_get("artist", self.kwargs("channel"))
|
|
||||||
|
|
||||||
@property
|
|
||||||
def artist_sanitized(self) -> str:
|
|
||||||
"""
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
str
|
|
||||||
The sanitized artist name.
|
|
||||||
"""
|
|
||||||
return sanitize_filename(self.artist)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def playlist_index(self) -> int:
|
def playlist_index(self) -> int:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
{
|
{
|
||||||
".ytdl-sub-music_video_playlist_test-download-archive.json": "25b8e44961343116436584e341c7fe9b",
|
".ytdl-sub-music_video_playlist_test-download-archive.json": "25b8e44961343116436584e341c7fe9b",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.1]-thumb.jpg": "b232d253df621aa770b780c1301d364d",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.1]-thumb.jpg": "b232d253df621aa770b780c1301d364d",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.1].info.json": "a1763e5afb49be0935d932334336f62f",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.1].info.json": "4a190d0ebb6d9b622a729c974be73632",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.1].mp4": "e66287b9832277b6a4d1554e29d9fdcc",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.1].mp4": "e66287b9832277b6a4d1554e29d9fdcc",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.1].nfo": "f8fd72bb97ed03938487494ad9094ca0",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.1].nfo": "f8fd72bb97ed03938487494ad9094ca0",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.27]-thumb.jpg": "d17c379ea8b362f5b97c6b213b0342cb",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.27]-thumb.jpg": "d17c379ea8b362f5b97c6b213b0342cb",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.27].info.json": "2d3b4299450776edd822514d071671a4",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.27].info.json": "595dfc58b7ba1eb212b778d6b28c35c6",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.27].mp4": "04ab5cb3cc12325d0c96a7cd04a8b91d",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.27].mp4": "04ab5cb3cc12325d0c96a7cd04a8b91d",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Feb.27].nfo": "6de4d997cfb300356072b4ebb09cbe38",
|
"JMC - Jesse's Minecraft Server [Trailer - Feb.27].nfo": "6de4d997cfb300356072b4ebb09cbe38",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Mar.21]-thumb.jpg": "e7830aa8a64b0cde65ba3f7e5fc56530",
|
"JMC - Jesse's Minecraft Server [Trailer - Mar.21]-thumb.jpg": "e7830aa8a64b0cde65ba3f7e5fc56530",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Mar.21].info.json": "17a942919cb951d7cfd0dcc502bf4499",
|
"JMC - Jesse's Minecraft Server [Trailer - Mar.21].info.json": "5075f5806bddb88e6df6ae26f6800805",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Mar.21].mp4": "025de6099a5c98e6397153c7a62d517d",
|
"JMC - Jesse's Minecraft Server [Trailer - Mar.21].mp4": "025de6099a5c98e6397153c7a62d517d",
|
||||||
"JMC - Jesse's Minecraft Server [Trailer - Mar.21].nfo": "f000a6ed8caacb62a134a6ca81e3f308",
|
"JMC - Jesse's Minecraft Server [Trailer - Mar.21].nfo": "f000a6ed8caacb62a134a6ca81e3f308",
|
||||||
"tvshow.nfo": "792b0594defdfd6642086b76fcc6a91b"
|
"tvshow.nfo": "e4123860532466ed5e0ebf2c9e44eb18"
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +34,6 @@ JMC - Jesse's Minecraft Server [Trailer - Mar.21].nfo
|
||||||
tvshow.nfo
|
tvshow.nfo
|
||||||
NFO tags:
|
NFO tags:
|
||||||
test:
|
test:
|
||||||
source_description: Trailers, Updates, etc
|
playlist_description: Trailers, Updates, etc
|
||||||
source_title: Jesse's Minecraft Server
|
playlist_title: Jesse's Minecraft Server
|
||||||
source_uploader: Project Zombie
|
playlist_uploader: Project Zombie
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
from unittest.mock import patch
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from conftest import assert_debug_log
|
|
||||||
from e2e.expected_download import assert_expected_downloads
|
from e2e.expected_download import assert_expected_downloads
|
||||||
from e2e.expected_transaction_log import assert_transaction_log_matches
|
from e2e.expected_transaction_log import assert_transaction_log_matches
|
||||||
|
|
||||||
from ytdl_sub.subscriptions.subscription import Subscription
|
from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
from ytdl_sub.utils.retry import logger as retry_logger
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|
@ -28,7 +24,7 @@ def channel_preset_dict(output_directory):
|
||||||
},
|
},
|
||||||
"output_directory_nfo_tags": {
|
"output_directory_nfo_tags": {
|
||||||
"tags": {
|
"tags": {
|
||||||
"source_uploader": "{source_uploader}",
|
"source_uploader": "{playlist_uploader}",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"overrides": {"tv_show_name": "Project / Zombie"},
|
"overrides": {"tv_show_name": "Project / Zombie"},
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ def playlist_preset_dict(output_directory):
|
||||||
"nfo_name": "tvshow.nfo",
|
"nfo_name": "tvshow.nfo",
|
||||||
"nfo_root": "test",
|
"nfo_root": "test",
|
||||||
"tags": {
|
"tags": {
|
||||||
"source_title": "{source_title}",
|
"playlist_title": "{playlist_title}",
|
||||||
"source_uploader": "{source_uploader}",
|
"playlist_uploader": "{playlist_uploader}",
|
||||||
"source_description": "{source_description}",
|
"playlist_description": "{playlist_description}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"subtitles": {
|
"subtitles": {
|
||||||
|
|
|
||||||
|
|
@ -20,19 +20,7 @@ def channel():
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def track_title():
|
def mock_youtube_video_to_dict(mock_entry_to_dict, playlist_index, playlist_size, channel):
|
||||||
return "not the title!"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def artist():
|
|
||||||
return "not the channel"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def mock_youtube_video_to_dict(
|
|
||||||
mock_entry_to_dict, playlist_index, playlist_size, channel, track_title, artist
|
|
||||||
):
|
|
||||||
return dict(
|
return dict(
|
||||||
mock_entry_to_dict,
|
mock_entry_to_dict,
|
||||||
**{
|
**{
|
||||||
|
|
@ -40,26 +28,18 @@ def mock_youtube_video_to_dict(
|
||||||
"playlist_size": playlist_size,
|
"playlist_size": playlist_size,
|
||||||
"channel": channel,
|
"channel": channel,
|
||||||
"channel_sanitized": channel,
|
"channel_sanitized": channel,
|
||||||
"track_title": track_title,
|
|
||||||
"track_title_sanitized": track_title,
|
|
||||||
"artist": artist,
|
|
||||||
"artist_sanitized": artist,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_youtube_video_kwargs(
|
def mock_youtube_video_kwargs(mock_entry_kwargs, playlist_index, playlist_size, channel):
|
||||||
mock_entry_kwargs, playlist_index, playlist_size, channel, track_title, artist
|
|
||||||
):
|
|
||||||
return dict(
|
return dict(
|
||||||
mock_entry_kwargs,
|
mock_entry_kwargs,
|
||||||
**{
|
**{
|
||||||
"playlist_index": playlist_index,
|
"playlist_index": playlist_index,
|
||||||
"playlist_count": playlist_size,
|
"playlist_count": playlist_size,
|
||||||
"channel": channel,
|
"channel": channel,
|
||||||
"track": track_title,
|
|
||||||
"artist": artist,
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue