ytarchiver

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7d36ec96cc4cc69910a9439aa850a0a75e3a4687
parent 33fe8ae2c6fe32528213fee813833cb1d18699dd
Author: lash <dev@holbrook.no>
Date:   Tue, 11 Aug 2026 17:10:57 -0600

Skip tags when exist, strip query string part

Diffstat:
Mcomplete.py | 8+++++++-
Aytdl-nfo-config/ytarchiver.yaml | 16++++++++++++++++
Aytdl-nfo-config/ytarchiver_episode.yaml | 16++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/complete.py b/complete.py @@ -9,10 +9,11 @@ import lxml.etree logging.basicConfig(level=logging.DEBUG) logg = logging.getLogger() + class YTMeta: def __init__(self, tree=None, remote=None): - self.o = tree + self.o = lxml.etree.fromstring('<?xml version="1.0" ?><episodedetails></episodedetails>') self.fp = None self.base = None self.wd = None @@ -46,6 +47,9 @@ class YTMeta: def process_tags(self, o): + if self.o.findall('tag'): + logg.info('found tag, skipping tag processing') + return for v in o['tags']: logg.info('add tag {}'.format(v)) element = lxml.etree.Element('tag') @@ -55,7 +59,9 @@ class YTMeta: def process_thumb(self, o): s = o['thumbnail'] + logg.debug('downloading thumbnail {}'.format(s)) ext = os.path.splitext(s)[1] + ext = ext.split('?')[0] fp = None with urllib.request.urlopen(s) as response: b = response.read() diff --git a/ytdl-nfo-config/ytarchiver.yaml b/ytdl-nfo-config/ytarchiver.yaml @@ -0,0 +1,16 @@ +movie: + - title: '{title}' + - uniqueid: + attr: + type: 'youtube' + default: "true" + value: '{id}' + - plot: '{description}' + - premiered: + convert: 'date' + input_f: '%Y%m%d' + output_f: '%Y-%m-%d' + value: '{upload_date}' + - credits: '{uploader_id}' + - originallanguage: '{language}' + - showlink: '{channel}' diff --git a/ytdl-nfo-config/ytarchiver_episode.yaml b/ytdl-nfo-config/ytarchiver_episode.yaml @@ -0,0 +1,16 @@ +episodedetails: + - title: '{title}' + - showtitle: '{uploader}' + - uniqueid: + attr: + type: 'youtube' + default: "true" + value: '{id}' + - plot: '{description}' + - premiered: + convert: 'date' + input_f: '%Y%m%d' + output_f: '%Y-%m-%d' + value: '{upload_date}' + - credits: '{uploader_id}' + - originallanguage: '{language}'