diff --git a/app/common/errors.py b/app/common/errors.py index 10fe8c1b..9f3eda4e 100644 --- a/app/common/errors.py +++ b/app/common/errors.py @@ -4,3 +4,19 @@ class NoMediaException(Exception): playlist name or similar, or the upstream source returned an error. ''' pass + + +class NoFormatException(Exception): + ''' + Raised when a media item is attempted to be downloaded but it has no valid + format combination. + ''' + pass + + +class DownloadFailedException(Exception): + ''' + Raised when a downloaded media file is expected to be present, but doesn't + exist. + ''' + pass diff --git a/app/common/static/styles/_template.scss b/app/common/static/styles/_template.scss index 4c86f31f..06ec9002 100644 --- a/app/common/static/styles/_template.scss +++ b/app/common/static/styles/_template.scss @@ -77,7 +77,7 @@ main { h2 { margin: 0; - padding: 2rem 0 0.5rem 0; + padding: 1.5rem 0 1rem 0; font-size: 1.5rem; } diff --git a/app/common/templates/infobox.html b/app/common/templates/infobox.html index 269dbd1d..4fb3b43a 100644 --- a/app/common/templates/infobox.html +++ b/app/common/templates/infobox.html @@ -3,7 +3,7 @@
Saving to: {{ media.source.directory_path }}
+Downloading to: {{ media.source.directory_path }}
{% if media.description %}{{ media.description|truncatewords:200 }}{% else %}(Media has no description).{% endif %}
+| {{ media.source }} | -|
| {{ media.title }} | -|
| {{ media.duration_formatted }} | |
| {{ media.filename }} | -|
| {{ media.source.format_summary }} | @@ -38,19 +45,51 @@{{ media.source.get_fallback_display }} |
| {% if media.downloaded %}{% else %}{% endif %} | +|
| {% if media.downloaded %}{% else %}{% endif %} | |
| {% if youtube_dl_format %}{% else %}{% endif %} | + {% if media.downloaded %} +|
| {{ media.filename }} | |
| {{ media.downloaded_filesize|filesizeformat }} | +|
| audio:{{ media.downloaded_audio_codec }}{% if media.downloaded_video_codec %}, video:{{ media.downloaded_video_codec }}{% endif %} | +|
| {{ media.downloaded_container|upper }} | +|
| {{ media.downloaded_fps }} FPS | +|
| {% if media.downloaded_hdr %}{% else %}{% endif %} | +|
| {% if youtube_dl_format %}{% else %}{% endif %} | +|
| {% for format in media.formats %} - ID: {{ format.format_id }}{% if format.vcodec|lower != 'none' %}, {{ format.format_note }} ({{ format.width }}x{{ format.height }}), fps:{{ format.fps|lower }}, video:{{ format.vcodec }} @{{ format.tbr }}k{% endif %}{% if format.acodec|lower != 'none' %}, audio:{{ format.acodec }} @{{ format.abr }}k / {{ format.asr }}Hz{% endif %} + + ID: {{ format.format_id }} + {% if format.vcodec|lower != 'none' %}, {{ format.format_note }} ({{ format.width }}x{{ format.height }}), fps:{{ format.fps|lower }}, video:{{ format.vcodec }} @{{ format.tbr }}k{% endif %} + {% if format.acodec|lower != 'none' %}, audio:{{ format.acodec }} @{{ format.abr }}k / {{ format.asr }}Hz{% endif %} + {% if format.format_id == combined_format or format.format_id == audio_format or format.format_id == video_format %}(matched){% endif %} + {% empty %} Media has no indexed available formats {% endfor %} @@ -59,15 +98,11 @@ | |
|
- Combined: {% if combined_format %}{{ combined_format }} {% if combined_exact %}(exact match){% else %}(fallback){% endif %}{% else %}No match{% endif %} - Audio: {% if audio_format %}{{ audio_format }} {% if audio_exact %}(exact match){% else %}(fallback){% endif %}{% else %}No match{% endif %} - Video: {% if video_format %}{{ video_format }} {% if video_exact %}(exact match){% else %}(fallback){% endif %}{% else %}No match{% endif %} + Combined: {% if combined_format %}{{ combined_format }} {% if combined_exact %}(exact match){% else %}(fallback){% endif %}{% else %}no match{% endif %} + Audio: {% if audio_format %}{{ audio_format }} {% if audio_exact %}(exact match){% else %}(fallback){% endif %}{% else %}no match{% endif %} + Video: {% if video_format %}{{ video_format }} {% if video_exact %}(exact match){% else %}(fallback){% endif %}{% else %}no match{% endif %} |
|
| {% if youtube_dl_format %}{{ youtube_dl_format }}{% else %}No matching formats{% endif %} | -