Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erreur python #4301

Open
i300220 opened this issue Jan 29, 2025 · 9 comments
Open

erreur python #4301

i300220 opened this issue Jan 29, 2025 · 9 comments

Comments

@i300220
Copy link

i300220 commented Jan 29, 2025

Décrivez le bug
Message d'erreur periodique

Votre system

  • OS: Linux Fedora 41
  • Appareil: ?
  • Version Kodi: 21.1 Flatpak
  • Version Vstream: 3.1.1

Log

2025-01-28 19:28:58.157 T:35242   error <general>: /home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py
2025-01-28 19:28:58.157 T:35242   error <general>: :32: 
2025-01-28 19:28:58.157 T:35242   error <general>: SyntaxWarning
2025-01-28 19:28:58.157 T:35242   error <general>: : 
2025-01-28 19:28:58.157 T:35242   error <general>: invalid escape sequence '\P'
2025-01-28 19:28:58.157 T:35242   error <general>: 
                                                   
2025-01-28 19:28:58.157 T:35242   error <general>:   
2025-01-28 19:28:58.157 T:35242   error <general>: sys.path.append('H:\Program Files\Kodi\system\Python\Lib\pysrc')
2025-01-28 19:28:58.157 T:35242   error <general>: 
                                                   
2025-01-28 19:28:58.223 T:35242    info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-28 19:28:58.448 T:35242    info <general>: 	[PLUGIN] vStream: load site cGui and call function setWatched
2025-01-28 19:28:58.462 T:35242    info <general>: 	[PLUGIN] vStream: SQL INSERT watched Successfully
2025-01-28 19:28:58.465 T:35242   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ValueError'>
                                                   Error Contents: substring not found
                                                   Traceback (most recent call last):
                                                     File "/home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py", line 319, in <module>
                                                       main()
                                                     File "/home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py", line 48, in __init__
                                                       self.parseUrl()
                                                     File "/home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py", line 100, in parseUrl
                                                       if isGui(sSiteName, sFunction):
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py", line 225, in isGui
                                                       exec("oGui." + sFunction + "()")
                                                     File "<string>", line 1, in <module>
                                                     File "/home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/resources/lib/gui/gui.py", line 874, in setWatched
                                                       db.insert_watched(meta)
                                                     File "/home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/resources/lib/db.py", line 284, in insert_watched
                                                       tvshowtitle = title[:title.rindex('E')].strip()
                                                                            ^^^^^^^^^^^^^^^^^
                                                   ValueError: substring not found
                                                   -->End of Python script error report<--
                                                   

Image

Plus

@TmpName
Copy link
Collaborator

TmpName commented Jan 29, 2025

Hello, moi je n'ai pas cette erreur de mon coté, mais le code essait de filtrer le titre en virant tout ce qui est apres le "E".
Tu aurais le titre de ta video ?
Il est facile d'eviter cette erreur, mais le probleme vient surement "d'avant" (le probleme est deja dans la base de donnée)
Es tu capable d'editer les fichiers du plugin ? Remplacer

tvshowtitle = title[:title.rindex('E')].strip()

par

if 'E' in title:
    tvshowtitle = title[:title.rindex('E')].strip()
else:
    tvshowtitle  = title

Mais il faut faire attention, tabulations, espaces c'est pas la meme chose en python, un espace en plus et c'est une erreur.

@i300220
Copy link
Author

i300220 commented Jan 29, 2025

Merci, aucun probleme, je suis programmeur moi-meme. Je corrige et je vous tiens au courant. Kodi 21.1 Flatpak si ma memoire est exacte utilise python 3,10. Il peut avoir de la difficulte avec la syntaxe 3.12.

Encore une fois si ma memoire ne me fait pas defaut, je ne suis plus capable de jouer aucun film ou serie avec cet addon a cause de cette erreur alors elle survient plutot alors que j'essaie de marquer un titre comme 'regarde'.

Mise a jour apres edition

Ca semble faire l'affaire. Je suis maintenant capable a nouveau de changer le status vu/non-vu sans declemcher cette erreur.

Je suis cependant aux prises avec l'erreur suivante depuis.

2025-01-29 09:53:50.177 T:283      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-29 09:53:50.411 T:283      info <general>: 	[PLUGIN] vStream: load site cGui and call function setWatched
2025-01-29 09:53:50.426 T:283      info <general>: 	[PLUGIN] vStream: SQL INSERT watched Successfully
2025-01-29 09:53:50.500 T:285      info <general>: Skipped 1 duplicate messages..
2025-01-29 09:52:06.446 T:187     error <general>: /home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py
2025-01-29 09:52:06.446 T:187     error <general>: :32: 
2025-01-29 09:52:06.446 T:187     error <general>: SyntaxWarning
2025-01-29 09:52:06.446 T:187     error <general>: : 
2025-01-29 09:52:06.446 T:187     error <general>: invalid escape sequence '\P'
2025-01-29 09:52:06.446 T:187     error <general>: 
                                                   
2025-01-29 09:52:06.447 T:187     error <general>:   
2025-01-29 09:52:06.447 T:187     error <general>: sys.path.append('H:\Program Files\Kodi\system\Python\Lib\pysrc')
2025-01-29 09:52:06.447 T:187     error <general>: 
                                                   
2025-01-29 09:52:06.529 T:187      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-29 09:52:06.781 T:187      info <general>: 	[PLUGIN] vStream: call load methode
2025-01-29 09:52:09.084 T:190     error <general>: /home/user/.var/app/tv.kodi.Kodi/data/addons/plugin.video.vstream/default.py
2025-01-29 09:52:09.084 T:190     error <general>: :32: 
2025-01-29 09:52:09.084 T:190     error <general>: SyntaxWarning
2025-01-29 09:52:09.084 T:190     error <general>: : 
2025-01-29 09:52:09.084 T:190     error <general>: invalid escape sequence '\P'
2025-01-29 09:52:09.084 T:190     error <general>: 

Ce n'est pas tres revelateur, j'en conviens.

@TmpName
Copy link
Collaborator

TmpName commented Jan 30, 2025

Tu as la variable DEBUG sur True ?

# Mettre True pour activer le debug
DEBUG = False

Remplaces les "\" par des "/" a la ligne 32

@i300220
Copy link
Author

i300220 commented Jan 30, 2025

Change pour

# Mettre True pour activer le debug
DEBUG = True

if DEBUG:

    import sys  # pydevd module need to be copied in Kodi\system\python\Lib\pysrc
    sys.path.append('H:/Program Files/Kodi/system/Python/Lib/pysrc')

et voici le resultat dans le log:

2025-01-30 10:07:39.728 T:7        info <general>: Loading skin file: MyVideoNav.xml, load type: KEEP_IN_MEMORY
2025-01-30 10:07:39.915 T:192      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:07:40.242 T:192     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:07:40.242 T:192      info <general>: 	[PLUGIN] vStream: load site french_stream and call function showSaisons
2025-01-30 10:07:46.142 T:200      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:07:46.400 T:200     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:07:46.401 T:200      info <general>: 	[PLUGIN] vStream: load site french_stream and call function showEpisodes
2025-01-30 10:07:50.251 T:7        info <general>: Loading skin file: DialogContextMenu.xml, load type: KEEP_IN_MEMORY
2025-01-30 10:07:52.080 T:226      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:07:52.316 T:226     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:07:52.316 T:226      info <general>: 	[PLUGIN] vStream: load site cGui and call function setWatched
2025-01-30 10:07:52.457 T:228      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:07:52.719 T:228     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:07:52.719 T:228      info <general>: 	[PLUGIN] vStream: load site french_stream and call function showEpisodes
2025-01-30 10:08:00.973 T:256      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:08:01.215 T:256     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:08:01.215 T:256      info <general>: 	[PLUGIN] vStream: load site french_stream and call function showEpisodes
2025-01-30 10:08:08.087 T:282      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:08:08.318 T:282     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:08:08.318 T:282      info <general>: 	[PLUGIN] vStream: load site cGui and call function setWatched
2025-01-30 10:08:08.441 T:284      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:08:08.704 T:284     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:08:08.704 T:284      info <general>: 	[PLUGIN] vStream: load site french_stream and call function showEpisodes
2025-01-30 10:08:14.608 T:310      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:08:14.843 T:310     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:08:14.843 T:310      info <general>: 	[PLUGIN] vStream: load site cGui and call function setWatched
2025-01-30 10:08:14.858 T:310      info <general>: 	[PLUGIN] vStream: SQL INSERT watched Successfully
2025-01-30 10:08:14.979 T:312      info <general>: Skipped 1 duplicate messages..
2025-01-30 10:08:14.979 T:312      info <general>: 	[PLUGIN] vStream: SQLITE 3 as DB engine for tmdb
2025-01-30 10:08:15.235 T:312     error <general>: Error: You must add org.python.pydev.debug.pysrc to your PYTHONPATH.
2025-01-30 10:08:15.235 T:312      info <general>: 	[PLUGIN] vStream: load site french_stream and call function showEpisodes

Merci beaucoup, je sens qu'on progresse.

@sizanic
Copy link
Collaborator

sizanic commented Jan 30, 2025

Ça ne progresse pas 😁
Mettre la variable à TRUE ne va rien apporter sans d'autres changements.
Et quand bien même, je ne vois pas vers quoi ça doit aller de faire ça 🤔

@i300220
Copy link
Author

i300220 commented Jan 30, 2025

Tout a fait d'accord @sizanic . En plus j'ai eu tellement de problemes par le passe avec Eclipse que je prefere m'en passer. C'etait mon IDE favori pour le php, completement configure, mais impossible de le mettre a jour, c'etait tout le temps brise. Alors surtout pas question d'installer ca sur une machine Fedora Linux.

@sizanic
Copy link
Collaborator

sizanic commented Jan 30, 2025

je regarderai le probleme prochainement, mais je suis trop occupé cette semaine.

@TmpName
Copy link
Collaborator

TmpName commented Feb 1, 2025

Non justement, je te demandais si tu l'avais mise a True.
Par defaut elle est sur False donc cette partie du code ne doit pas etre atteinte, mais de corriger les "\" par des "/" ne sera pas inutile.

@i300220
Copy link
Author

i300220 commented Feb 1, 2025

@TmpName variable remise a False; je confirme pour les barres obliques: l'erreur est disparue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants