emericg / OpenSubtitlesDownload

Automatically find and download the right subtitles for your favorite videos!
https://emeric.io/OpenSubtitlesDownload
GNU General Public License v3.0
607 stars 66 forks source link

Use XmlRpc DownloadSubtitles instead of direct link #71

Closed Tony4dev closed 3 years ago

Tony4dev commented 3 years ago

This is related to #70 the problem is that the program uses hard-coded URL instead of XmlRpc API.

Thanks to using the API the download method doesn't have to be different per environment. Also, maybe some dependencies may be removed. The code might probably need some polishing, I am not that familiar with Python.

Also notice, that I only fixed the usage per item (subtitle), but the subs could be downloaded in bulk (one request, could help with #44 ), maybe it would be worth to refactor the code to reflect that too.

emericg commented 3 years ago

Hi! This looks promising I'll have a look at it tomorrow, but you did nuke a couple of features, including the download UI ^^

Tony4dev commented 3 years ago

Hi! This looks promising I'll have a look at it tomorrow, but you did nuke a couple of features, including the download UI ^^

Yeah, you might want to refactor and test it properly, I only had lunchtime for this and tested it only few times locally on Gnome. Or just use it as a guideline, because I think it would be really nice if all subs could be loaded in one request as mentioned above, but it needs broader refactor than I can provide with my limited knowledge and time.

emericg commented 3 years ago

I'm accepting this pull request so you get the commit credit, but I'll revert everything that's not related to XmlRpc download and only in CLI mode (for now). I'm still not sure what to do regarding the GUI download progressbar... The way it is done now, the download window and wget are run simultaneously, and you can both see how much time the download take and get a chance to cancel it if you want, which I think is cool.

Tony4dev commented 3 years ago

Thanks, hopefully somebody else can help you with the rest.