<tr><th>description:</th><td>{{video_data.description}}</td></tr>
<tr><th>duration:</th><td>{{video_data.duration}}</td></tr>
<tr><th>definition:</th><td>{{video_data.definition}}</td></tr>
-<tr><th>YouTube ID:</th><td>{{video_data.id_}}</td></tr>
+<tr><th>YouTube ID:</th><td>{% if youtube_prefix|length > 0 %}<a href="{{youtube_prefix}}{{video_data.id_}}">{{video_data.id_}}{% else %}{{video_data.id_}}{% endif %}</td></tr>
<tr><th>download:</th><td id="status"></td></tr>
<tr>
<th>linked queries:</th>
PlomHttpHandler, PlomHttpServer, PlomQueryMap, MIME_APP_JSON)
from ytplom.db import Hash, DbConn
from ytplom.misc import (
- FilterStr, FlagName, QueryId, QueryText, TagSet, YoutubeId,
- FILE_FLAGS, PATH_THUMBNAILS, ensure_expected_dirs,
- Config, DownloadsManager, Player, QuotaLog, VideoFile, YoutubeQuery,
- YoutubeVideo
+ FILE_FLAGS, PATH_THUMBNAILS, YOUTUBE_URL_PREFIX, ensure_expected_dirs,
+ Config, DownloadsManager, FilterStr, FlagName, Player, QueryId, QueryText,
+ QuotaLog, TagSet, VideoFile, YoutubeId, YoutubeQuery, YoutubeVideo
)
from ytplom.primitives import NotFoundException, PATH_APP_DATA
'is_temp': video_id in self.server.downloads.ids_unfinished,
'file_digest': file_digest,
'file_path': file_path,
- 'queries': linked_queries})
+ 'queries': linked_queries,
+ 'youtube_prefix': (
+ YOUTUBE_URL_PREFIX if self.server.config.link_originals
+ else '')})
def _send_yt_queries_index_and_search(self) -> None:
with DbConn() as conn:
'tags_prefilter_needed': [],
'tags_display_whitelist': [],
'tags_default': ['new'],
- 'allow_file_edit': True
+ 'allow_file_edit': True,
+ 'link_originals': True
}
# type definitions for mypy
tags_prefilter_whitelist: TagSet
tags_display_whitelist: TagSet
tags_default: TagSet
+ link_originals: bool
def __init__(self):
def set_attrs_from_dict(d):