plugin.video.sendtokodi icon indicating copy to clipboard operation
plugin.video.sendtokodi copied to clipboard

Error while opening SendToKodi directly from Kodi

Open GautamMKGarg opened this issue 3 years ago • 3 comments

Describe the bug If we try to open "SendToKodi" plugin directly from Kodi. Kodi throws error.

To Reproduce Open Kodi >> Go to Addons Section >> Click on SendToKodi. It will throw error.

Expected behavior If we open SendToKodi from Kodi, it should not throw error. Either setting page should be displayed (similar to Yatse). Or we can make it even better by asking user to enter the URL directly in Kodi. Once user enters Youtube or any other extractor's link, code can be executed to play that video/music.

Kodi and sendtokodi version (please complete the following information):

  • Kodi: [Matrix 19.4]
  • Addon: [master]

Provide a Kodi log

  • If you do not know how the get the log check the official Kodi wiki

2022-09-10 20:41:51.943 T:5920    ERROR <general>: Control 55 in window 10025 has been asked to focus, but it can't
2022-09-10 20:41:51.959 T:27652    INFO <general>: initializing python engine.
2022-09-10 20:41:55.055 T:27652   ERROR <general>: ERROR: [generic] '' is not a valid URL. Set --default-search "ytsearch" (or run  yt-dlp "ytsearch:" ) to search YouTube
                                                   
2022-09-10 20:41:55.057 T:27652   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'lib.yt_dlp.utils.DownloadError'>
                                                   Error Contents: ERROR: [generic] '' is not a valid URL. Set --default-search "ytsearch" (or run  yt-dlp "ytsearch:" ) to search YouTube
                                                   Traceback (most recent call last):
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\extractor\common.py", line 670, in extract
                                                       ie_result = self._real_extract(url)
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\extractor\generic.py", line 2615, in _real_extract
                                                       raise ExtractorError(
                                                   lib.yt_dlp.utils.ExtractorError: '' is not a valid URL. Set --default-search "ytsearch" (or run  yt-dlp "ytsearch:" ) to search YouTube
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\YoutubeDL.py", line 1459, in wrapper
                                                       return func(self, *args, **kwargs)
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\YoutubeDL.py", line 1535, in __extract_info
                                                       ie_result = ie.extract(url)
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\extractor\common.py", line 696, in extract
                                                       raise type(e)(e.orig_msg, **kwargs)
                                                   lib.yt_dlp.utils.ExtractorError: [generic] '' is not a valid URL. Set --default-search "ytsearch" (or run  yt-dlp "ytsearch:" ) to search YouTube
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\service.py", line 250, in <module>
                                                       result = ydl.extract_info(url, download=False)
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\YoutubeDL.py", line 1448, in extract_info
                                                       return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\YoutubeDL.py", line 1477, in wrapper
                                                       self.report_error(str(e), e.format_traceback())
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\YoutubeDL.py", line 994, in report_error
                                                       self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
                                                     File "C:\Users\GG\AppData\Roaming\Kodi\addons\plugin.video.sendtokodi\lib\yt_dlp\YoutubeDL.py", line 934, in trouble
                                                       raise DownloadError(message, exc_info)
                                                   lib.yt_dlp.utils.DownloadError: ERROR: [generic] '' is not a valid URL. Set --default-search "ytsearch" (or run  yt-dlp "ytsearch:" ) to search YouTube
                                                   -->End of Python script error report<--
                                                   
2022-09-10 20:41:55.171 T:27652    INFO <general>: Python interpreter stopped
2022-09-10 20:41:55.177 T:10228   ERROR <general>: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.sendtokodi/
2022-09-10 20:41:55.188 T:5920    ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.sendtokodi/) failed


GautamMKGarg avatar Sep 10 '22 15:09 GautamMKGarg

@firsttris @nullket

GautamMKGarg avatar Sep 10 '22 15:09 GautamMKGarg

it was intended as service addon, before it didnt do this, maybe some code change lead to this behaviour

firsttris avatar Sep 18 '22 05:09 firsttris

it was intended as service addon, before it didnt do this, maybe some code change lead to this behaviour

Unless you've changed something drastically since last I looked, isn't this still a "plugin" addon and not a "script" addon (absolutely awful terminology, I agree)? Hence Kodi should be free to treat it as a directory node in its library node hierarchy (I'm sure they call it a "virtual file system" or something equally confusing).

From my understanding you can't have a plug-in be a service, since it's just a glorified name for a callback.

anohren avatar Mar 12 '23 13:03 anohren