2022-01-19, 21:36
Where I am at:
After much internal debate, I decided to leave script.module.youtube.dl alone and create script.module.yt-dlp in its place. I did this for several reasons:
Progress so far:
Working on this did bring up a recent concern that I have with Kodi addons. There is a bug which a draconian fix was put in. It impacts locale, etc. In particular, it broke unicode characters in filenames. The work around is easy enough (encode the file path on file open to utf-8). But this may nab a number of people. Time will tell. It also causes locale.getdefaultlocale and getPreferredEncoding to behave less than perfectly. UTF-8 still works, but there are some subtle edge cases.
I'll try to have a workable version within a week. Some day I'll get to release RandomTrailers.
After much internal debate, I decided to leave script.module.youtube.dl alone and create script.module.yt-dlp in its place. I did this for several reasons:
- I do not like addons putting exported code in lib, but rather a child directory with something identifying it what it belongs to. I'm concerned that the namespace (top level python path) could get a bit cluttered.
- Along with the previous change, the imports had to change as well. Sigh. Sorry.
- There were some who were using an older version on python 2 kodi, and I suppose wanted the door open to continue updating it.
Progress so far:
- The port to the new yt-dlp lib is not so bad.
- The problem is that there seem to be a backlog of problems in the YouTubeDL wrapper code. Many of these appear to be due to the Python 3 migration. I have found places where strings are being converted to hex and back when they don't need to. It is also common to not specify encoding options on file operations.
- My big accomplishment today was to be able to download something playing on Youtube using the YouTubeDL-Control app. Never mind that the file name is very long garbage, etc. The main thing is that it sort of worked.
Working on this did bring up a recent concern that I have with Kodi addons. There is a bug which a draconian fix was put in. It impacts locale, etc. In particular, it broke unicode characters in filenames. The work around is easy enough (encode the file path on file open to utf-8). But this may nab a number of people. Time will tell. It also causes locale.getdefaultlocale and getPreferredEncoding to behave less than perfectly. UTF-8 still works, but there are some subtle edge cases.
I'll try to have a workable version within a week. Some day I'll get to release RandomTrailers.