tubesync icon indicating copy to clipboard operation
tubesync copied to clipboard

"ERROR: Parse error at position 35" and then Failed to download media Error logged

Open depuhitv opened this issue 1 year ago • 4 comments

Hi meeb, While downloading the Julia Childs playlist https://www.youtube.com/playlist?list=PLlRSZrtZRI6Ceg0yl7lz9RRwgxVDWAbUq with the following settings

Type 	YouTube playlist
Name 	Julia Childs - The French Chef
Media items 	133
Key 	PLlRSZrtZRI6Ceg0yl7lz9RRwgxVDWAbUq
Directory 	Julia Childs - The French Chef
Filter text 	
Media format 	{title_full}.{ext}
Example filename 	Some Media Title Name.mkv
Index schedule 	Every 7 days
Index videos? 	Y
Index streams? 	N
Download media? Y	
Created 	2024-12-01 14:36:42
Last crawl 	2024-12-01 14:36:45
Source resolution 	2160p (4K)
Source video codec 	VP9
Source audio codec 	OPUS
Prefer 60FPS? 	Y
Prefer HDR? 	N
Output extension 	mkv
Fallback 	Get next best resolution or codec instead
Copy thumbnails? Y	
Write NFO? 	N
Write JSON? N	
Delete removed media	N 	
Delete files on disk 	N
Delete old media 	No, keep forever
UUID 	0c911526-0c75-4188-ad3a-28415e18b000
Embed thumbnail?: 	N
Embed metadata?: 	N
SponsorBlock?: 		N
Download subtitles?: 	Y	
Auto-generated subtitles?: 	Y
Subs langs?: 	en

The error logs show parse error right before the failed to download message. This issue isnt consistent and some of the videos are downloaded but a lot of them are failing. In all these cases, there are no temporary files on disk either (I am using unraid) which are present when I usually have the Failed to download media error messages.

2024-12-02 22:20:40,273 [tubesync/INFO] Downloading media: T70sQv0VjpE (UUID: 88db830f-7ca2-409d-b4fe-822b8f41df91) to: "/downloads/video/Julia Childs - The French Chef/Your Own French Onion Soup  The French Chef Season 5  Julia Child.mkv"
2024-12-02 22:20:40,407 [tubesync/INFO] Downloading media: TEYEEmBnp4M (UUID: ed93f1ec-0ce8-41ce-be06-48fde174c288) to: "/downloads/video/Julia Childs - The French Chef/Veal For A King  The French Chef Season 2  Julia Child.mkv"
ERROR: Parse error at position 35 (near 'Style:\n::cue(c.cyan) { color: cyan; }\n##\n\n00:00:01.067 --> 00:00:03.202\nViewers like you make\nthis p')
2024-12-02 22:20:43,847 [tubesync/ERROR] Failed to download media: TEYEEmBnp4M (UUID: ed93f1ec-0ce8-41ce-be06-48fde174c288) to disk, expected outfile does not exist: /downloads/video/Julia Childs - The French Chef/Veal For A King  The French Chef Season 2  Julia Child.mkv
Rescheduling Downloading media for "Veal For A King | The French Chef Season 2 | Julia Child"
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/background_task/tasks.py", line 43, in bg_runner
    func(*args, **kwargs)
  File "/app/sync/tasks.py", line 452, in download_media
    raise DownloadFailedException(err)
common.errors.DownloadFailedException: Failed to download media: TEYEEmBnp4M (UUID: ed93f1ec-0ce8-41ce-be06-48fde174c288) to disk, expected outfile does not exist: /downloads/video/Julia Childs - The French Chef/Veal For A King  The French Chef Season 2  Julia Child.mkv
Rescheduling task Downloading media for "Veal For A King | The French Chef Season 2 | Julia Child" for 0:00:06 later at 2024-12-02 11:20:49.885198+00:00
ERROR: Parse error at position 35 (near 'Style:\n::cue(c.cyan) { color: cyan; }\n##\n\n00:00:02.368 --> 00:00:05.438\nThis is just a plain,\nordina')
2024-12-02 22:20:43,945 [tubesync/ERROR] Failed to download media: T70sQv0VjpE (UUID: 88db830f-7ca2-409d-b4fe-822b8f41df91) to disk, expected outfile does not exist: /downloads/video/Julia Childs - The French Chef/Your Own French Onion Soup  The French Chef Season 5  Julia Child.mkv
Rescheduling Downloading media for "Your Own French Onion Soup | The French Chef Season 5 | Julia Child"
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/background_task/tasks.py", line 43, in bg_runner
    func(*args, **kwargs)
  File "/app/sync/tasks.py", line 452, in download_media
    raise DownloadFailedException(err)
common.errors.DownloadFailedException: Failed to download media: T70sQv0VjpE (UUID: 88db830f-7ca2-409d-b4fe-822b8f41df91) to disk, expected outfile does not exist: /downloads/video/Julia Childs - The French Chef/Your Own French Onion Soup  The French Chef Season 5  Julia Child.mkv
Rescheduling task Downloading media for "Your Own French Onion Soup | The French Chef Season 5 | Julia Child" for 0:00:06 later at 2024-12-02 11:20:50.026501+00:00

depuhitv avatar Dec 02 '24 11:12 depuhitv

Ah, looks like someone sneaked in some CSS into the description and the { is throwing the metadata parser off. Thanks for the report.

meeb avatar Dec 02 '24 11:12 meeb

Thanks for looking into it so quickly! I can't see any css in the metadata column in the database, but I can say the text "Viewers like you make" in the error message is part of the auto-generated subtitles.

depuhitv avatar Dec 02 '24 11:12 depuhitv

Disabling all subtitles settings seems to solve the problem and the videos download without an issue then.

depuhitv avatar Dec 02 '24 12:12 depuhitv

Thanks for the update, even if there are errors with the subtitles it shouldn't generate an exception locally so I'll hack something in for better subtitle handling.

meeb avatar Dec 02 '24 12:12 meeb