From 78646614c41f7d8e8d35b254c83ce2b7d38299b7 Mon Sep 17 00:00:00 2001 From: Bugale Bugalit Date: Wed, 26 Jun 2024 12:12:52 +0300 Subject: [PATCH 1/4] feat: remove partial unsuccessful results --- buganime/buganime.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/buganime/buganime.py b/buganime/buganime.py index 737b132..042f788 100644 --- a/buganime/buganime.py +++ b/buganime/buganime.py @@ -141,10 +141,18 @@ def process_file(input_path: str) -> None: logging.info('ffprobe %s wrote %s, %s', str(proc.args), proc.stderr, proc.stdout) video_info = parse_streams(json.loads(proc.stdout)['streams']) - with lock_mutex(name=UPSCALE_MUTEX_NAME): - logging.info('Running Upscaler') - asyncio.run(transcode.Transcoder(input_path=input_path, output_path=output_path, height_out=2160, width_out=3840, video_info=video_info).run()) - logging.info('Upscaler for %s finished', input_path) + try: + with lock_mutex(name=UPSCALE_MUTEX_NAME): + logging.info('Running Upscaler') + asyncio.run(transcode.Transcoder(input_path=input_path, output_path=output_path, height_out=2160, width_out=3840, video_info=video_info).run()) + logging.info('Upscaler for %s finished', input_path) + except Exception: + logging.warning('Upscaler for %s failed. Deleting output %s', input_path, output_path) + try: + os.unlink(output_path) + except Exception: + pass + raise def process_path(input_path: str) -> None: From 7f2e5e234b5003c36a32f306b63ec1b9531d46fd Mon Sep 17 00:00:00 2001 From: Bugale Bugalit Date: Wed, 26 Jun 2024 12:09:47 +0300 Subject: [PATCH 2/4] feat: accept only textual subtitle codecs --- buganime/buganime.py | 5 +- tests/data/8.json | 1503 ++++++++++++++++++++++++++++++++++++++++ tests/test_buganime.py | 1 + 3 files changed, 1508 insertions(+), 1 deletion(-) create mode 100644 tests/data/8.json diff --git a/buganime/buganime.py b/buganime/buganime.py index 042f788..dc1660f 100644 --- a/buganime/buganime.py +++ b/buganime/buganime.py @@ -19,6 +19,8 @@ OUTPUT_DIR = os.getenv('BUGANIME_OUTPUT_DIR', '') UPSCALE_MUTEX_NAME = 'anime4kconvert' +SUPPORTED_SUBTITLE_CODECS = ('ass', 'subrip') + @contextlib.contextmanager def lock_mutex(name: str) -> Iterator[None]: @@ -69,7 +71,8 @@ def _get_subtitle_stream_index() -> int: for i, stream in enumerate(subtitle_streams): match stream: case {'tags': {'language': str(lang)}} if lang in ('en', 'eng'): - if all(x not in stream['tags'].get('title', '').upper() for x in ('S&S', 'SIGNS', 'FORCED')): + if all(x not in stream['tags'].get('title', '').upper() for x in ('S&S', 'SIGNS', 'FORCED')) and \ + stream['codec_name'].lower() in SUPPORTED_SUBTITLE_CODECS: relevant_streams.append((i, stream)) if not relevant_streams: if len(subtitle_streams) == 1: diff --git a/tests/data/8.json b/tests/data/8.json new file mode 100644 index 0000000..6fff4ef --- /dev/null +++ b/tests/data/8.json @@ -0,0 +1,1503 @@ +{ + "streams": [ + { + "index": 0, + "codec_name": "hevc", + "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", + "profile": "Main 10", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "coded_width": 1920, + "coded_height": 1080, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 2, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p10le", + "level": 120, + "color_range": "tv", + "color_space": "bt709", + "color_transfer": "bt709", + "color_primaries": "bt709", + "chroma_location": "left", + "refs": 1, + "r_frame_rate": "24000/1001", + "avg_frame_rate": "24000/1001", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "extradata_size": 2115, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "title": "Presented By EMBER", + "BPS-eng": "1847873", + "DURATION-eng": "00:25:11.510000000", + "NUMBER_OF_FRAMES-eng": "36240", + "NUMBER_OF_BYTES-eng": "349134984", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 1, + "codec_name": "ac3", + "codec_long_name": "ATSC A/52A (AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "BPS-eng": "192000", + "DURATION-eng": "00:24:12.032000000", + "NUMBER_OF_FRAMES-eng": "45376", + "NUMBER_OF_BYTES-eng": "34848768", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 2, + "codec_name": "ac3", + "codec_long_name": "ATSC A/52A (AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "jpn", + "BPS-eng": "192000", + "DURATION-eng": "00:24:12.032000000", + "NUMBER_OF_FRAMES-eng": "45376", + "NUMBER_OF_BYTES-eng": "34848768", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 3, + "codec_name": "hdmv_pgs_subtitle", + "codec_long_name": "HDMV Presentation Graphic Stream subtitles", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 1126, + "start_time": "1.126000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Dialogue", + "BPS-eng": "66872", + "DURATION-eng": "00:24:09.156000000", + "NUMBER_OF_FRAMES-eng": "666", + "NUMBER_OF_BYTES-eng": "12113546", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 4, + "codec_name": "hdmv_pgs_subtitle", + "codec_long_name": "HDMV Presentation Graphic Stream subtitles", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 1126, + "start_time": "1.126000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Signs & Songs", + "BPS-eng": "9440", + "DURATION-eng": "00:24:09.156000000", + "NUMBER_OF_FRAMES-eng": "79", + "NUMBER_OF_BYTES-eng": "1710081", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 5, + "codec_name": "ass", + "codec_long_name": "ASS (Advanced SSA) subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 1040, + "start_time": "1.040000", + "extradata_size": 4181, + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Signs & Songs@EMBER", + "BPS-eng": "1135", + "DURATION-eng": "00:24:09.220000000", + "NUMBER_OF_FRAMES-eng": "943", + "NUMBER_OF_BYTES-eng": "205788", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 6, + "codec_name": "ass", + "codec_long_name": "ASS (Advanced SSA) subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 590, + "start_time": "0.590000", + "extradata_size": 4185, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Dialogue@MTBB", + "BPS-eng": "1275", + "DURATION-eng": "00:24:09.670000000", + "NUMBER_OF_FRAMES-eng": "1388", + "NUMBER_OF_BYTES-eng": "231126", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v36.0.0 ('Is That Jazz?') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2021-04-19 01:35:59", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES" + } + }, + { + "index": 7, + "codec_name": "mjpeg", + "codec_long_name": "Motion JPEG", + "profile": "Progressive", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 361, + "height": 500, + "coded_width": 361, + "coded_height": 500, + "closed_captions": 0, + "film_grain": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "361:500", + "pix_fmt": "yuvj444p", + "level": -99, + "color_range": "pc", + "color_space": "bt470bg", + "chroma_location": "center", + "refs": 1, + "r_frame_rate": "90000/1", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "bits_per_raw_sample": "8", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 1, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "cover.jpg", + "mimetype": "image/jpeg" + } + }, + { + "index": 8, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 62480, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "LT_3italic_1.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 9, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 62536, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "LTFinnegan_MediumItalic_0.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 10, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 51068, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "MerriweatherSans-Bold.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 11, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 50968, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "MerriweatherSans-ExtraBold.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 12, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 47112, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "MerriweatherSans-Light.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 13, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 48528, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "MerriweatherSans-Regular.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 14, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 30432, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "MGS4 Brush.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 15, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 32892, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "SNICSN_.TTF", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 16, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 44916, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "Swiss_721_Bold_Rounded_BT_0.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 17, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 28508, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "thebestofmylovebold.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 18, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 46864, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "THROWMYHANDSUPINTHEAIRV2.TTF", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 19, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 59032, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "VAG Rounded Black.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 20, + "codec_name": "otf", + "codec_long_name": "OpenType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 15956, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "Vegur-Bold.otf", + "mimetype": "application/vnd.ms-opentype" + } + }, + { + "index": 21, + "codec_name": "otf", + "codec_long_name": "OpenType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 15300, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "Vegur-Light.otf", + "mimetype": "application/vnd.ms-opentype" + } + }, + { + "index": 22, + "codec_name": "otf", + "codec_long_name": "OpenType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 15248, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "Vegur-Regular.otf", + "mimetype": "application/vnd.ms-opentype" + } + }, + { + "index": 23, + "codec_name": "otf", + "codec_long_name": "OpenType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 37316, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "AurulentSans-Regular.otf", + "mimetype": "application/vnd.ms-opentype" + } + }, + { + "index": 24, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 77504, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "AveriaSerif-Light.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 25, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 44300, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "BakerSignet.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 26, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 68332, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "bl-norm.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 27, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 30760, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "Blur.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 28, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 80148, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "CALIST.TTF", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 29, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 35056, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "DCPRyuuMoji-W12.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 30, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 213260, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "DFPMARUGOTHIC-W6-KAMI-WINP-RKSJ-H.TTF", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 31, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 68344, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "Formata.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 32, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 74504, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "FOTMODEMINSTDBOLD.TTF", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 33, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 18164, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "HollySharpie.ttf", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 34, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 177632, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "KOZUKAGOTHICPROM-ENG-MEDIUM.TTF", + "mimetype": "application/x-truetype-font" + } + }, + { + "index": 35, + "codec_name": "ttf", + "codec_long_name": "TrueType font", + "codec_type": "attachment", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/90000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 136035900, + "duration": "1511.510000", + "extradata_size": 206272, + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "filename": "KOZUKAGOTHICREGULARNORAGAMI.TTF", + "mimetype": "application/x-truetype-font" + } + } + ], + "format": { + "filename": "C:\\Temp\\Torrents\\SNAFU S01-S03+OVA 1080p Dual Audio BDRip 10 bits DD x265-EMBER\\SNAFU S02+OVA 1080p Dual Audio BDRip 10 bits DD x265-EMBER\\Series\\S02E01-Nobody Knows Why They Came to the Service Club [7CE95AC0].mkv", + "nb_streams": 36, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "1511.510000", + "size": "435432703", + "bit_rate": "2304623", + "probe_score": 100, + "tags": { + "title": "S02E01-EMBER", + "encoder": "libebml v1.3.9 + libmatroska v1.5.2", + "creation_time": "2021-04-19T01:35:59.000000Z" + } + } +} \ No newline at end of file diff --git a/tests/test_buganime.py b/tests/test_buganime.py index 4722af5..8dd3be0 100644 --- a/tests/test_buganime.py +++ b/tests/test_buganime.py @@ -87,6 +87,7 @@ def test_parse_filename(path: str, result: buganime.TVShow | buganime.Movie) -> ('5.json', transcode.VideoInfo(audio_index=2, subtitle_index=1, width=1920, height=1080, fps='24000/1001', frames=35638)), ('6.json', transcode.VideoInfo(audio_index=1, subtitle_index=0, width=1920, height=1080, fps='30/1', frames=7425)), ('7.json', transcode.VideoInfo(audio_index=1, subtitle_index=0, width=1920, height=1080, fps='24000/1001', frames=0)), + ('8.json', transcode.VideoInfo(audio_index=2, subtitle_index=3, width=1920, height=1080, fps='24000/1001', frames=36240)), ] From 4a807c5245cc58c4d6bb0508ef2cdb0392e9951e Mon Sep 17 00:00:00 2001 From: Bugale Bugalit Date: Thu, 27 Jun 2024 14:39:10 +0300 Subject: [PATCH 3/4] Revert "build: temporarily pin pytorch to 2.2.2" This reverts commit e76efedc4a8b4dbf7336e72df179a04148f0944f. --- dev-requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 0ca5412..0469855 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -7,5 +7,4 @@ mypy tqdm-stubs types-retry types-requests -torch<2.3.0 # Due to https://github.com/pytorch/pytorch/issues/124897 -r requirements.txt \ No newline at end of file From e2784ba3317ed4f19e4b68406de05b5bbb1c67e3 Mon Sep 17 00:00:00 2001 From: Bugale Bugalit Date: Thu, 27 Jun 2024 14:48:26 +0300 Subject: [PATCH 4/4] build: temporarily pin numpy to <2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2133ee7..6fe7f94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ pywin32 opencv-python requests tqdm -numpy +numpy<2.0.0,>=1.16.0 # https://github.com/pytorch/pytorch/issues/78341 retry torch torchvision