marcopeocchi / yt-dlp-web-ui

A terrible web ui for yt-dlp. Designed to be self-hosted.
Mozilla Public License 2.0
657 stars 67 forks source link

Other Sources and Error Logging #122

Open Baipyrus opened 5 months ago

Baipyrus commented 5 months ago

Hi again,

I know this sounds kind of dumb because we're talking abou YouTube-DLP, but hear me out.

I frequently use yt-dlp to download from other websites such as Reddit or Twitter (yes, I know you can just download from them directly). The issue here is that the Dashboard does not display any status information about these types of downloads (although the downloads still work fine).

The UI I used previously simply displayed all downloads as logs to see progress. It was probably just piping the yt-dlp output into a log file (I think they were *.txt). This was problematic and unattractive on it's own, but at least you had some kind of instant feedback.

My request here would be to add the good looking status cards as used for YouTube videos.

Thanks in advance and keep up the good work!

Baipyrus commented 5 months ago

Weird, apparently it's working today. Maybe I was just dumb?

marcopeocchi commented 5 months ago

Hello @Baipyrus,

Sorry for the late response. Regarding the card info it kinda depends by yt-dlp itself, i just parse the response of the video "metadata".

As for the logs, it's a really cool topic! I've got some other applications that show the logs on the ui, so 80% is basically copy&paste.

Baipyrus commented 5 months ago

Hello again,

a few more days of trying to download from both Twitter and Reddit passed again. Everything seems to be working just fine most of the time, and I seem to have figured out what my problem was. As you might've already guessed, this is a simple case of user error. I assume that the time I failed to download a Video and thus opened this issue, I was also trying to download from Twitter. And to be more specific, I was probably using my own templates.

The error: Twitter Videos seem to only allow a single quality/source ("HTTP-2176 - +"). This just will not work under the format parameters "-f ba+bv", which I use in a template to download videos more quickly. The biggest problem with this is the fact that the UI will not give you any feedback to the download. Once it failed to download because of a template specifying the format that it could not get, it will put you back onto the dashboard without an error or any status. I've only just figured this out once I switched back to the format selection setting.

Another weird thing that might occur is that, when a Video is posted as a response in a quoted Tweet, the download will fail on fetch, not even being prompted the format selection, giving you an error on the UI.

Anyways though, I really do appreciate the work put into this project and thank you very much for the good work!

marcopeocchi commented 5 months ago

I'm glad you "solved" the card content issue.

About the logs, I'm implementing a sort of "live logging" with a buffer of 1000 lines (it may vary). I don't really want to deal with files, log rotation, etc... A the moment it's still very basic. Screenshot 2024-01-08 alle 12 37 36

Logs are "consumed" by the ui and not persisted. When I'll find a good solution to efficiently buffer the logs I will push the feature.

Let me know if it's a good compromise or if file based logging is preferable.

Baipyrus commented 5 months ago

I think at some point, file based logging definitely shines the brightes. However, since I suggested this as a way of getting more (even if highly detailed) feedback. So on a very basic level, this is perfect.

This could also serve to throw details of server errors whenever, so admins can see what happened after encountering that error page. Similarly, it works for my issue earlier too, because the user would not get any feedback or errors when the video could not be downloaded.

marcopeocchi commented 3 months ago

File base logging has been implemented 🥳.

In order to activate it just pass the -lf <log file path> flag to set the logging file and -fl flag to activate it. Atm, logs can be outputted to the /config volume (using docker); if a new volume is needed let me know.