Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Related to: #152
So in efforts to allow php applications to start downloads, report on download status I've been thinking of added database support to youtube-dl. The reason for doing this is that a php application can call youtube-dl, and then forget about it. It can then read the contents of a database to report on the video status.
I'm no expert on this, so feel free to give me any better ideas
The plan (unless anyone has any better ideas) is to create a new fuction called to_output that will ether send output to the screen or to a database. Any existing calls to to_screen(message) will need to be changed to to_output(message, messagetype).
The extra input (message type) will be used to determine what type of message is being received. Errors, DownloadPercentage, FileSize, etc. Then the value can be stored in message.
to_screen would then be used to displaying that information in a useful way to the screen. So instead of using
You would use:
to_output would then contain a lot of code to ether pass the information to to_database, or transform the text into something useful to to_screen:
This is quite a lot of work, it means all the non-data infromation will be stored in to_screen, but it then allows other output methods to be added later using just the data.
The other method is just to just write to a database and leave the existing to_screen code alone. No messing around with the existing to_screen code, but then I'll need to create a log_to_database call after every to_screen call. Which I feel is just wrong.