rickeylohia / plugin.video.stalkervod

Stalker VOD Kodi add-on
GNU General Public License v3.0
11 stars 3 forks source link

Impossible to open a VOD video #18

Closed Macadoshis closed 4 months ago

Macadoshis commented 5 months ago

Hi,

Using the plugin for the very first time. Here is the error I got when clicking a genre of VOD (ex. "VOD UK"). Thus the videos are not even listed in the screen, I just cannot make it further that listing the genres.

2024-06-09 01:41:03.583 T:2873    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'int' object has no attribute 'isnumeric'
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.stalkervod/addon_entry.py", line 7, in <module>
                                                       run(argv)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.stalkervod/lib/addon.py", line 280, in run
                                                       stalker_addon.router(argv[2][1:])
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.stalkervod/lib/addon.py", line 265, in router
                                                       self.__list_vod_favorites(params)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.stalkervod/lib/addon.py", line 119, in __list_vod_favorites
                                                       StalkerAddon.__create_video_listing(videos, params)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.stalkervod/lib/addon.py", line 151, in __create_video_listing
                                                       if video['time'] and video['time'].isnumeric() and video['time'] != '0':
                                                                            ^^^^^^^^^^^^^^^^^^^^^^^
                                                   AttributeError: 'int' object has no attribute 'isnumeric'
                                                   -->End of Python script error report<--

Same error for all categories. That's strange because through REST I had a look at the results for a category I clicked, and on the first page and further (especially the 1st since I think it's the only one you're supposed to land to and fetch time attributes), and all results have the time.

ex. : GET /server/load.php?type=vod&action=get_ordered_list&sortby=added&p=3i&genre=159

{"id":"117765","owner":"","name":"The Marvels [FR]","old_name":"","o_name":"The Marvels [FR]","fname":"","description":"N\/A","pic":"","cost":0,"time":104,"file":"","path":"The_Marvels_[FR]","protocol":"","rtsp_url":"","censored":0,"series":[],"volume_correction":0,"category_id":"67","genre_id":0,"genre_id_1":0,"genre_id_2":0,"genre_id_3":0,"hd":1,"tmdb_id":null,"genre_id_4":0,"cat_genre_id_1":"67","cat_genre_id_2":0,"cat_genre_id_3":0,"cat_genre_id_4":0,"director":"N\/A","actors":"N\/A","year":"N\/A","accessed":1,"status":1,"disable_for_hd_devices":0,"added":"2024-03-21 18:03:30","count":0,"count_first_0_5":0,"count_second_0_5":0,"vote_sound_good":0,"vote_sound_bad":0,"vote_video_good":0,"vote_video_bad":0,"rate":"","last_rate_update":"","last_played":"","for_sd_stb":0,"rating_imdb":"N\/A","rating_count_imdb":"","rating_last_update":"0000-00-00 00:00:00","age":"12+","high_quality":0,"rating_kinopoisk":"N\/A","comments":"","low_quality":0,"is_series":0,"year_end":0,"autocomplete_provider":"imdb","screenshots":"","is_movie":1,"lock":0,"fav":0,"for_rent":0,"screenshot_uri":"","genres_str":"N\/A","cmd":"hidden_cmd_by_me","week_and_more":"March 2024","has_files":0}

What is wrong with "time":104 that raises the error not to be numeric ? Is it expecting a string ? Is it a contract in stalker "get_ordered_list" that my provider is not implementing correctly ? If yes would it be possible to be more lenient in addon.py:151 to first check against type int in addition to string to handle a larger scope of types ? I think I'm not using the only provider which expose this int vs string problem for time attribute.

Thank you.

KODI version : 20.2.0 (2023-06-29) Plugin version : rickey - 0.0.6

Macadoshis commented 5 months ago

I just see that you're indeed expecting time as a string :

https://github.com/rickeylohia/plugin.video.stalkervod/blob/dff055bd22bdba58f40d8f0642ffadfc24bd9718/tests/responses/videos.json#L18

Can you please be more lenient in all numeric values from json results ? ("myprop": "[\d]*" U "myprop": [\d]* )

Either at the time of reading a myprop attribute (by always wrapping either type into a str(..)), or more generally by stringifying all values just after you receive the json payload (before your addon routines of reading props).

I can share with you in private my provider for reproductible test, but I think it's enough if you create another test by removing the quotes in the test data videos.json (by adding a second video in the json, with numeric types instead of quoted ints).

rickeylohia commented 5 months ago

sure let me update the plugin accordingly

untiiis commented 5 months ago

There is always the same error which is repeated each time, impossible to access the VOD files, (I responded in previous issues previously)

Macadoshis commented 5 months ago

@untiiis can you please share the link to your issue so we can link each other if they're indeed related ? (I don't find an issue opened by your user from https://github.com/rickeylohia/plugin.video.stalkervod/issues?q=)

Macadoshis commented 5 months ago

sure let me update the plugin accordingly

thank you very much @rickeylohia, we'll be eagerly watching for the update :)

untiiis commented 5 months ago

@Macadoshis sorry, my bad, it's not an issue, I responded under the previous issues

rickeylohia commented 5 months ago

pushed v0.0.7 with the fix, let me know if that fixes it https://github.com/xbmc/repo-plugins/pull/4528

Macadoshis commented 5 months ago

Thank you very much @rickeylohia this was quick :) Let's hope for the https://github.com/xbmc/repo-plugins/pull/4528 to be approved soon, and I'll tell you if the 0.0.7 will fix the bug on my TV.

(btw I didn't know the source code were located at 2 different places, https://github.com/rickeylohia/plugin.video.stalkervod and https://github.com/xbmc/repo-plugins/tree/nexus/plugin.video.stalkervod, this duplication of code and fixes sounds like a pain to maintain and follow ; I already participated in a PR for the stalker pvr plugin (C++) but we only have to commit and deploy from a single repo... but anyway, I'm still new to the xmbc environment :) )

untiiis commented 5 months ago

@rickeylohia

There is always the same error Now, access to the folder is possible but the movies are not played and I also noticed that the series/tv show folders are not displayed, only the movies folde

Traceback (most recent call last): File "C:\Users\Legion\AppData\Roaming\Kodi\addons\plugin.video.stalkervod\addon_entry.py", line 7, in run(argv) File "C:\Users\Legion\AppData\Roaming\Kodi\addons\plugin.video.stalkervod\lib\addon.py", line 293, in run stalker_addon.router(argv[2][1:]) File "C:\Users\Legion\AppData\Roaming\Kodi\addons\plugin.video.stalkervod\lib\addon.py", line 270, in router self.play_video(params['video_id'], params['series']) File "C:\Users\Legion\AppData\Roaming\Kodi\addons\plugin.video.stalkervod\lib\addon.py", line 30, in play_video stream_url = Api.get_vod_stream_url(video_id, series) File "C:\Users\Legion\AppData\Roaming\Kodi\addons\plugin.video.stalkervod\lib\api.py", line 104, in get_vod_stream_url stream_url = Api.call_stalker_portal( File "C:\Users\Legion\AppData\Roaming\Kodi\addons\plugin.video.stalkervod\lib\api.py", line 40, in call_stalker_portal return response.json() File "C:\Users\Legion\AppData\Roaming\Kodi\addons\script.module.requests\lib\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0) -->End of Python script error report<--

is this related to stalker plugin or script.module.request

rickeylohia commented 5 months ago

@untiiis will check and try to fix seems the portal that I am using works a bit differently

untiiis commented 5 months ago

@rickeylohia if you want, i give you a portal to test

Macadoshis commented 4 months ago

pushed v0.0.7 with the fix, let me know if that fixes it xbmc/repo-plugins#4528

@rickeylohia thank you for the fix. This indeed now lets me enter the video genre and list the movies. Hence this issue can be closed.

Unfortunately, it is now failing when opening a video, for the exact same reason than channels I explained in issue https://github.com/rickeylohia/plugin.video.stalkervod/issues/17 (ffmpeg protocol prefix).

Steps for an example vid :

1) Videos in selected genre GET http://*****.to:8080/portal.php?type=vod&action=get_ordered_list&sortby=added&p=1i&genre=67

Response :

{
    "js": {
        "total_items": 2959,
        "max_page_items": 14,
        "selected_item": 0,
        "cur_page": 0,
        "data": [{
            "id": "119994",
            "owner": "",
            "name": "Wish (2023) [FR]",
            "old_name": "",
            "o_name": "Wish (2023) [FR]",
            "fname": "",
            "description": "N\/A",
            "pic": "",
            "cost": 0,
            "time": 94,
            "file": "",
            "path": "Wish_(2023)_[FR]",
            "protocol": "",
            "rtsp_url": "",
            "censored": 0,
            "series": [],
            "volume_correction": 0,
            "category_id": "67",
            "genre_id": 0,
            "genre_id_1": 0,
            "genre_id_2": 0,
            "genre_id_3": 0,
            "hd": 1,
            "tmdb_id": null,
            "genre_id_4": 0,
            "cat_genre_id_1": "67",
            "cat_genre_id_2": 0,
            "cat_genre_id_3": 0,
            "cat_genre_id_4": 0,
            "director": "N\/A",
            "actors": "N\/A",
            "year": "N\/A",
            "accessed": 1,
            "status": 1,
            "disable_for_hd_devices": 0,
            "added": "2024-06-13 17:07:53",
            "count": 0,
            "count_first_0_5": 0,
            "count_second_0_5": 0,
            "vote_sound_good": 0,
            "vote_sound_bad": 0,
            "vote_video_good": 0,
            "vote_video_bad": 0,
            "rate": "",
            "last_rate_update": "",
            "last_played": "",
            "for_sd_stb": 0,
            "rating_imdb": "N\/A",
            "rating_count_imdb": "",
            "rating_last_update": "0000-00-00 00:00:00",
            "age": "12+",
            "high_quality": 0,
            "rating_kinopoisk": "N\/A",
            "comments": "",
            "low_quality": 0,
            "is_series": 0,
            "year_end": 0,
            "autocomplete_provider": "imdb",
            "screenshots": "",
            "is_movie": 1,
            "lock": 0,
            "fav": 0,
            "for_rent": 0,
            "screenshot_uri": "",
            "genres_str": "N\/A",
            "cmd": "eyJ0eXBlIjoibW92aWUiLCJzdHJlYW1faWQiOiIxMTk5OTQiLCJzdHJlYW1fc291cmNlIjpudWxsLCJ0YXJnZXRfY29udGFpbmVyIjoiW1wibWt2XCJdIn0=",
            "week_and_more": "Last week",
            "has_files": 0
        }, ...]
    }
}

2) Select movie Wish (2023)

GET http://*****.to:8080/portal.php?type=vod&action=create_link&cmd=eyJ0eXBlIjoibW92aWUiLCJzdHJlYW1faWQiOiIxMTk5OTQiLCJzdHJlYW1fc291cmNlIjpudWxsLCJ0YXJnZXRfY29udGFpbmVyIjoiW1wibWt2XCJdIn0=&series=&forced_storage=undefined&disable_ad=0&download=0&JsHttpRequest=1-xml `

Response:

{
    "js": {
        "id": "119994",
        "cmd": "ffmpeg http:\/\/**********.xyz:8080\/movie\/WErgHKPi2k\/J6oiNUJvyA\/119994.mkv?play_token=pjojfVaJ1m",
        "load": "",
        "subtitles": [],
        "error": ""
    }
}

Expected: Movie to open

Actual: Error :

info <general>: Creating InputStream
warning <general>: CreateLoader - unsupported protocol(ffmpeg http) in ffmpeg http://**********.xyz:8080//WErgHKPi2k/J6oiNUJvyA//./?play_token=Vbkkz7XF7W
error <general>: CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.stalkervod/?action=play&video_id=119994&series=0]

1) Why the link to the stream in CreateLoader is not the same as the create_link response ? 2) Why does the ffmpeg gets prepended as a part of the URI of the stream to open ? 3) The link does work since if I paste it to VLC (Ctrl-N > Open network URL), the video opens successfully. image

Thank you

Macadoshis commented 4 months ago

(I can share with you in private my iptv settings if you want to reproduce the issue)

rickeylohia commented 4 months ago

i do have credential from one other user @Steha78 which has the same issue, and I think have made it work will try to push it soon and if it still does not work will get iptv settings from you

rickeylohia commented 4 months ago

@Macadoshis @untiiis issue should be fixed with v1.0.0. But I haven't pushed it to the official repo yet. Can you guys use below zip to install the latest version and test it out before I push it to the official repo. If you guys can let me know the result either way if everything looks good / there are still any issues you guys see.

plugin.video.stalkervod-1.0.0.zip

untiiis commented 4 months ago

@rickeylohia Thank you I'm coming to test it quickly on my smartphone, with my mac portal The tv channels work, the series folder work, on the other hand the vod folder, for the movies I have an error (Unlike the server you put included, the movies worked)

I'll put the log when I test on pc

Macadoshis commented 4 months ago

@rickeylohia 1.0.0 tested with the same source that failed with 0.0.7.

Thanks a lot for your work and quick answer, this finally fixes my open bug https://github.com/rickeylohia/plugin.video.stalkervod/issues/17 and you have my go to release this alpha 😄 💪

untiiis commented 4 months ago

@rickeylohia

I follow up on my previous comment I tested with two Mac portals, it works perfectly with the series and tv folder

but I still have the same error when I want to launch a film from the vod folder

error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

rickeylohia commented 4 months ago

thanks @untiiis for testing since the new build is working for @Macadoshis but not for your portal and I am not able to figure out the issue with just the log. would you mind sharing portal/mac details so that I can replicate the issue at my end? we can figure out a way to share it privately rather than here on github

untiiis commented 4 months ago

@rickeylohia ok, no worries, I can send you that in private message or email or something else

rickeylohia commented 4 months ago

@untiiis do you have a discord account?

untiiis commented 4 months ago

@rickeylohia yeah, I forgot my password, I don't use it so much can I join you on discord?

rickeylohia commented 4 months ago

@untiiis my discord username fierygreywind if you are able to login to it

rickeylohia commented 4 months ago

plugin.video.stalkervod-1.0.0.zip @untiiis can you try with above again also added support for UpNext addon

untiiis commented 4 months ago

@rickeylohia Hi, Really thank you, everything works wonderfully The tv channels ✅ The series folder ✅ The movies folder ✅ Up Next ✅ Thank you for your work, you are the boss 😎

if I may allow myself one last thing and suggest something, not necessarily immediately : to add a "research" section In the main menu that navigates all folders and sub-folders to find series or movies and why not a kind of bookmark-favorites from the addon specifically to the series and another for movies (I'm not talking about kodi favorites or superfavorites addon)

Thank you 🙏

untiiis commented 4 months ago

@rickeylohia I'm giving you a second feedback, When I watch a movie or series, and I fast forward or I go back, suddenly the playing stops Sometimes just after you start playing what would it be linked to ?

rickeylohia commented 4 months ago

I don't exactly follow your suggestion regarding Research option Regarding bookmark-favorites from the addon, its already there on the VOD and series option there are two menu options Add to favorites -> Portal/Addon Favorite Add to favourites -> Kodi Favourite option And you access the portal favorite items, by going to VOD Favorites for all VOD favs or for category specific, going to Favorites on the context menu of each category. Same applied to Series as well

Screenshot 2024-07-14 at 6 53 46 PM Screenshot 2024-07-14 at 6 53 32 PM
rickeylohia commented 4 months ago

reg the playback issue am not sure. Probably related to the portal itself. I did try with your portal and didn't see any issue with playback though.

untiiis commented 4 months ago

@rickeylohia Maybe it's related to the portal, I tested with another portal, I had the same thing, I tested on smartphone (more powerful than Android box)

It sometimes happens on the reading stops

Than you for response 😊

rickeylohia commented 4 months ago

issues should be fixed with v1.0.0 and be available in official kodi repo soon