Closed nullket closed 1 year ago
I made the search for a "valid" manifest a bit less restrictive, this should also close https://github.com/firsttris/plugin.video.sendtokodi/issues/70
Issue #72 not resolved. Getting bellow error
2022-09-06 17:00:32.616 T:908 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'KeyError'>
Error Contents: 'formats'
Traceback (most recent call last):
File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 250, in <module>
startingItem = createListItemFromVideo(ydl.extract_info(startingVideoUrl, download=False))
File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 120, in createListItemFromVideo
url = extract_best_all_in_one_stream(result)
File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 95, in extract_best_all_in_one_stream
for entry in result['formats']:
KeyError: 'formats'
-->End of Python script error report<--
This is the another Error which I am getting on another URL
2022-09-06 17:10:46.985 T:24032 ERROR <general>: CDVDDemuxFFmpeg::Open - error probing input format, https://media-content1.akamaized.net/video/afff35ba48ce69be34bf89ead3f993a9/10/dash/h265_main.mpd
2022-09-06 17:10:46.985 T:24032 ERROR <general>: CVideoPlayer::OpenDemuxStream - Error creating demuxer
Issue https://github.com/firsttris/plugin.video.sendtokodi/issues/72 not resolved. Getting bellow error
Interesting. Please be so kind and
btw the mxplayer link in issue 73 resolves just fine for me (I get the original manifest) but Kodi is not able to play it. VLC on the other hand can. This is due to the fact that not all adapting streaming manifests are currently supported by the input stream adaptive
plugin we rely on. Therefore, I am highly interested how yatse gets kodi to play this video (thus requesting a log for that)
2022-09-06 19:56:12.321 T:32580 INFO <general>: JSONRPC Server: New connection added
2022-09-06 19:56:12.560 T:25304 INFO <general>: initializing python engine.
2022-09-06 19:56:16.446 T:25304 INFO <general>: plugin.video.sendtokodi: found original manifest: https://media-content.akamaized.net/video/0feb23ed2f6cb0ddc0839d5317053b14/1/dash/h265_main.mpd
2022-09-06 19:56:16.450 T:25304 INFO <general>: CPythonInvoker(7, C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py): script successfully run
2022-09-06 19:56:16.556 T:25304 INFO <general>: Python interpreter stopped
2022-09-06 19:56:16.631 T:6572 INFO <general>: VideoPlayer::OpenFile: plugin://plugin.video.sendtokodi/?https://www.mxplayer.in/show/watch-aashram/season-1/duh-swapna-online-d445579792b0135598ba1bc9088a84cb
2022-09-06 19:56:16.668 T:19644 INFO <general>: Creating InputStream
2022-09-06 19:56:16.838 T:19644 INFO <general>: Creating Demuxer
2022-09-06 19:56:16.855 T:19644 ERROR <general>: CDVDDemuxFFmpeg::Open - error probing input format, https://media-content.akamaized.net/video/0feb23ed2f6cb0ddc0839d5317053b14/1/dash/h265_main.mpd
2022-09-06 19:56:16.855 T:19644 ERROR <general>: CVideoPlayer::OpenDemuxStream - Error creating demuxer
2022-09-06 19:56:16.855 T:19644 INFO <general>: CVideoPlayer::OnExit()
2022-09-06 19:56:16.858 T:25884 INFO <general>: Deleting settings information for files plugin://plugin.video.sendtokodi/?https://www.mxplayer.in/show/watch-aashram/season-1/duh-swapna-online-d445579792b0135598ba1bc9088a84cb
2022-09-06 19:56:16.868 T:6572 INFO <general>: Loading skin file: DialogConfirm.xml, load type: KEEP_IN_MEMORY
2022-09-06 19:56:16.870 T:6572 INFO <general>: CVideoPlayer::CloseFile()
2022-09-06 19:56:16.871 T:6572 INFO <general>: VideoPlayer: waiting for threads to exit
2022-09-06 19:56:16.871 T:6572 INFO <general>: VideoPlayer: finished waiting
Second URL: https://www.mxplayer.in/show/watch-doctor-stranger-hindi-dubbed-series-online-7dd1b7a353d2a1ca62b672248e17865b Logs:
2022-09-06 19:59:56.896 T:32580 INFO <general>: JSONRPC Server: New connection added
2022-09-06 19:59:56.943 T:31636 INFO <general>: initializing python engine.
2022-09-06 19:59:59.133 T:20120 INFO <general>: CActiveAESink::OpenSink - initialize sink
2022-09-06 20:00:01.968 T:31636 INFO <general>: plugin.video.sendtokodi: could not find an original manifest falling back to best all-in-one stream
2022-09-06 20:00:01.969 T:31636 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'KeyError'>
Error Contents: 'formats'
Traceback (most recent call last):
File "C:\Users\Gautam\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 250, in <module>
startingItem = createListItemFromVideo(ydl.extract_info(startingVideoUrl, download=False))
File "C:\Users\Gautam\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 120, in createListItemFromVideo
url = extract_best_all_in_one_stream(result)
File "C:\Users\Gautam\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 95, in extract_best_all_in_one_stream
for entry in result['formats']:
KeyError: 'formats'
-->End of Python script error report<--
2022-09-06 20:00:02.134 T:31636 INFO <general>: Python interpreter stopped
I added below code at Line number 136 of service.py file, and it fixed issue with first URL mentioned above. https://github.com/nullket/plugin.video.sendtokodi/blob/use_orignal_manifest/service.py#L136
if 'mpd' in url:
list_item.setProperty('inputstream', 'inputstream.adaptive')
list_item.setProperty('inputstream.adaptive.manifest_type', 'mpd')
I have taken reference of above code from yatse https://github.com/Tolriq/repository.yatse.kodi/blob/0e994240717d652c6fe84e0b40c2e418a1051492/script.yatse.kodi/lib/utils.py#L87-L88
Please check if this code has an impact on any other functionality. Also please check if we can improve if 'mpd' in url:
condition.
I added below code at Line number 136 of service.py file, and it fixed issue with first URL mentioned above.
Yikes! I forgot that. I will add and test it the next days (might take a bit)
Please check if this code has an impact on any other functionality. Also please check if we can improve if 'mpd' in url: condition.
Yeah, no worries. We just need to check if we are using a manifest and if yes reuse this to automatically choose mpd/hls/ipm
, for further reference take a look here.
You seconds URL does not seem to be resolved with yt-dlp at all. It seems to be a playlist (instead of a single video) but the "entries" list which should be there for a playlist is empty. But that might be a geoblock for me. For you it might fail because something with the playlist is on our side broken. To test something like this please always check if the standalone version of yt-dlp is working. Install it from here https://github.com/yt-dlp/yt-dlp and if it does not work, open an issue there.
Yes, looks like second URL is not working even for me. There might be some issue with yt-dlp itself. I did not test second URL with Yatse. Will you be able to provide your email address? I will send you an code, which might be useful for you.
Found another issue with the code. Below URL was working fine in earlier version. with this code it's not working
https://www.hungama.com/song/tumse-pyaar-karke/82061100/
Logs
2022-09-08 01:17:26.265 T:24148 INFO <general>: initializing python engine.
2022-09-08 01:17:29.760 T:24148 INFO <general>: plugin.video.sendtokodi: could not find an original manifest falling back to best all-in-one stream
2022-09-08 01:17:29.760 T:24148 INFO <general>: plugin.video.sendtokodi: Error: was not able to extract manifest or all-in-one stream. Implement https://github.com/firsttris/plugin.video.sendtokodi/issues/34
2022-09-08 01:17:29.760 T:24148 INFO <general>: CPythonInvoker(12, C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py): script aborted
2022-09-08 01:17:29.868 T:24148 INFO <general>: Python interpreter stopped
Found another issue with the code. Below URL was working fine in earlier version. with this code it's not working
Resolving is rather slow, to avoid resolving a second time with ytdlp (like yatse) just the get the "best" stream, I tried to write my own "get the best all in one stream" from the already resolved formats list. I just have not thought about audio only streams. Should be fixed now (the meta fields seems to be optional, thus getting the correct format seems to be really more guessing than knowing - if it remains unstable we should look into detail how ytdlp does it on their end)
Yes, looks like second URL is not working even for me. There might be some issue with yt-dlp itself. I did not test second URL with Yatse.
It is either an issue with yt-dlp itself or simply an unsupported feature.
I added below code at Line number 136 of service.py file, and it fixed issue with first URL mentioned above.
Yikes! I forgot that. I will add and test it the next days (might take a bit)
Should be fixed. Please test it again and report back.
Thanks @nullket
All the issues reported earlier are now fixed. I conducted few more tests. here are the other issues I am facing now
2022-09-10 17:28:20.520 T:29120 INFO <general>: initializing python engine.
2022-09-10 17:28:24.351 T:29120 ERROR <general>: WARNING: [Voot] Ignoring subtitle tracks found in the HLS manifest; if any subtitle tracks are missing, please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
2022-09-10 17:28:24.385 T:29120 INFO
2022-09-10 17:28:24.588 T:29120 INFO
2. URL: https://www.zee5.com/movies/details/robot/0-0-movie_466418637
2022-09-10 17:35:50.182 T:22632 INFO
2022-09-10 17:35:54.585 T:22632 INFO
All the issues reported earlier are now fixed. I conducted few more tests. here are the other issues I am facing now URL: https://www.voot.com/shows/asur/1/922885/the-dead-can-talk/922976
I don't think there is so much we can do about this. It has a result['manifest_url']
with the value https://cdnapisec.kaltura.com/p/1982551/playManifest/pt/https/f/applehttp/t/web/e/0_8mvarek0
and as far as I understand yt-dlp
the manifest url should have a file ending OR deliver at least some readable xml. For the manifest_url is simply a blank 404. I assume this to be, an issue with yt-dlp OR missing info on my side on how to retrieve the actual manifest from that url OR some DRM issue. On the other hand I repurposed the function to get the manifest type to test if the manifest is valid at all. So your url should now fallback to the best all in one stream (so no adapative quality management). Anyway your video seems to be drm protected and thus unsupported. In the future please test you videos with the standalone version of yt-dlp FIRST!
URL: https://www.zee5.com/movies/details/robot/0-0-movie_466418637
The manifest url had some additional ending. Fixed that in a more robust way to get the correct manifest type.
Please retest EVERYTHING and if something does not work please make sure it works with the standalone version of ytdlp.
After recent change (https://github.com/firsttris/plugin.video.sendtokodi/pull/74/commits/5f7758d96e4185bac92ecc0b8787d739bf776c7c), below URL again stopped working. Before this commit, it was working fine.
2022-09-14 12:06:21.875 T:20732 INFO <general>: initializing python engine.
2022-09-14 12:06:25.677 T:20732 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'KeyError'>
Error Contents: 'manifest_url'
Traceback (most recent call last):
File "C:\Users\Gautam\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 295, in <module>
xbmcplugin.setResolvedUrl(__handle__, True, listitem=createListItemFromVideo(result))
File "C:\Users\Gautam\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 148, in createListItemFromVideo
url = extract_manifest_url(result)
File "C:\Users\Gautam\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 87, in extract_manifest_url
if 'manifest_url' in entry and 'vcodec' in entry and get_adaptive_type_from_url(result['manifest_url']):
KeyError: 'manifest_url'
-->End of Python script error report<--
2022-09-14 12:06:25.800 T:20732 INFO <general>: Python interpreter stopped
That was an unfortunate copy paste error. Please try again.
Thanks @nullket I conducted several tests, all of them are working fine. I think code is ready to be merged.
@firsttris it finally works. This will close https://github.com/firsttris/plugin.video.sendtokodi/issues/70, https://github.com/firsttris/plugin.video.sendtokodi/issues/72 and improve quality for some sites. As this is a bigger change I would welcome if you could review this PR - of course as always whenever you have the time for it :)
Good work!
Thanks @nullket and @firsttris
When are you planning to release the next stable version of sendtokodi? It's okay to update the code on Windows/Linux but it's difficult to update code on Smart TV using github.
why is it difficult? you just install the repo and the addon updates automatically?
on SmartTV you can use Eplorer feature of Kodi to copy the repo
Sorry, The version which was downloaded from repo was showing as "0.9.277" and the version in the master was 100.0.0. That's why I got confused. Now I noticed that both are same. Sorry for the confusion.
Should close https://github.com/firsttris/plugin.video.sendtokodi/issues/72 and increase the quality on a couple of websites. This does not implement custom manifests on websites which hide the manifest url (like youtube).
I had the most of it ready for the development of https://github.com/firsttris/plugin.video.sendtokodi/issues/34
I assume this might fail catastrophic
Therefore, I made a setting for it and disabled the feature by default until a few heroes have tested it in the field.
The changes to the addon.xml requires at least kodi 18.