2023-01-24, 19:52
This is one of the most bizarre things I have seen; I use Kodi 19.5 on Android 7 device. Here are steps to reproduce:
Now do this:
Log viewer says:
Ok, thanks - WHY did you fail to unpack the archive? How come you did not fail to unpack the archive last time? So fucking stupid ...
Then, for good measure - erase that line you've added to router.py, then recreate the .zip again - and try to install it in Kodi: yes, it installs fine, "Add-on updated" (!!!)
Then, again add a new line at the same position, add enough spaces so intentation matches, and write, and save the file. Then recreate the .zip again - and try to install it in Kodi. Result: "Failed to install add-on from zip file"; and Kodi log says:
WTF - how does a change to "router.py" result with error in "addon.xml" at line 0? This is insane ...
I really don't understand why these changes to the zip cause such problems; I've tried hacking Kodi addons before, and I've never had this problem before.
Has the procedure for creating .zips changed? Maybe I have to cryptographically sign them now, or some procedure like that? Is the format and the procedure of creating an Addon zip for Kodi documented anywhere?
What the hell is going on here?
- Go to https://github.com/mintsoft/repo-plugins...sitystream - it contains fix for a Kodi addon
- Since I just want the directory zipped (do not want to get the entire git repository), go to https://download-directory.github.io/ - and paste the previous link in the field that says "Paste GitHub.com folder URL + press Enter" and ... press Enter
- A zip called "mintsoft repo-plugins curiositystream-matrix-fix plugin.video.curiositystream.zip" will be downloaded
- first, unzip it into a directory (on my Ubuntu 20.04, "Extract Here" will extract the files in the zip in a newly created directory called "mintsoft repo-plugins curiositystream-matrix-fix plugin.video.curiositystream")
- Rename the unzipped directory "mintsoft repo-plugins curiositystream-matrix-fix plugin.video.curiositystream" to "plugin.video.curiositystream"
- Finally, zip the newly renamed *directory* "plugin.video.curiositystream" into a new zip file, "plugin.video.curiositystream_fix_2.0.2+matrix.2_mintsoft.zip"
- From the bash command line, this can be done (if you're in the parent directory) with: bash:
zip -r plugin.video.curiositystream_fix_2.0.2+matrix.2_mintsoft.zip plugin.video.curiositystream
- From the bash command line, this can be done (if you're in the parent directory) with:
- Copy the newly created plugin.video.curiositystream_fix_2.0.2+matrix.2_mintsoft.zip to somewhere where Kodi can read it.
Now do this:
- Find the file router.py in the unpacked directory: plugin.video.curiositystream/resources/lib/router.py and open it in a text editor
- Find the line "def _play_media(self, media):" - then find the line "play_item.setSubtitles([c["file"] for c in stream["subtitles"]])" right after it; here press Enter to add a newline, then save the router.py file
- Remove the previous zip file "plugin.video.curiositystream_fix_2.0.2+matrix.2_mintsoft.zip"
- Again zip the directory "plugin.video.curiositystream" into a zip file "plugin.video.curiositystream_fix_2.0.2+matrix.2_mintsoft.zip"
- Have Kodi install this updated zip via "Install from zip file": it will report "Installation failed"
Log viewer says:
Code:
2023-01-24 18:31:08.577 T:13813 ERROR <general>: Failed to unpack archive 'zip://nfs%3a%2f%2f1...%2fplugin.video.curiositystream_fix_2.0.2%2bmatrix.2_mintsoft.zip/plugin.video.curiositystream/' to '/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/temp/a2e31590-a27d-4d9a-b903-7e24e0c4d194'
Ok, thanks - WHY did you fail to unpack the archive? How come you did not fail to unpack the archive last time? So fucking stupid ...
Then, for good measure - erase that line you've added to router.py, then recreate the .zip again - and try to install it in Kodi: yes, it installs fine, "Add-on updated" (!!!)
Then, again add a new line at the same position, add enough spaces so intentation matches, and write
Code:
print("aaa")
Code:
2023-01-24 18:43:32.898 T:6487 ERROR <general>: CAddonInfoBuilder::Generate: Unable to load 'zip://nfs%3a%2f%2f1...%2fplugin.video.curiositystream_fix_2.0.2%2bmatrix.2_mintsoft.zip/plugin.video.curiositystream/addon.xml', Line 0
Failed to open file
WTF - how does a change to "router.py" result with error in "addon.xml" at line 0? This is insane ...
I really don't understand why these changes to the zip cause such problems; I've tried hacking Kodi addons before, and I've never had this problem before.
Has the procedure for creating .zips changed? Maybe I have to cryptographically sign them now, or some procedure like that? Is the format and the procedure of creating an Addon zip for Kodi documented anywhere?
What the hell is going on here?