The movie database python ошибка

Bug report

Description

When updating the library after adding new movies, I received a couple of errors on screen that the add-on has stopped and should look in the event log.
Some movies have been added with correct informations into my library.
When I try to update the information for the other, not recognized movies I will receive the same error again.

There is no difference when I switch the search language from en-US to de-DE or back in the setting of the Movie Scraper Module

Log File snippet

`2021-10-19 22:54:34.069 T:16688 INFO : initializing python engine.
2021-10-19 22:54:34.364 T:16688 INFO : [metadata.themoviedb.org.python]: Find movie with title ‘3 Engel für Charlie — Volle Power’ from year ‘None’
2021-10-19 22:54:34.373 T:16688 ERROR : EXCEPTION Thrown (PythonToCppException) : —>Python callback/script returned the following error<—
— NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class ‘UnboundLocalError’>
Error Contents: local variable ‘search_results’ referenced before assignment
Traceback (most recent call last):
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 185, in
run()
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 172, in run
search_for_movie(params[«title»], params.get(«year»), params[‘handle’], settings)
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 40, in search_for_movie
if not search_results:
UnboundLocalError: local variable ‘search_results’ referenced before assignment
—>End of Python script error report<—

2021-10-19 22:54:34.811 T:16688 WARNING : CPythonInvoker(400, /storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py): the python script «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py» has left several classes in mem
ory that we couldn’t clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-10-19 22:54:34.811 T:16688 INFO : Python interpreter stopped
2021-10-19 22:54:34.813 T:16687 ERROR : GetDirectory — Error getting plugin://metadata.themoviedb.org.python/?action=find&pathSettings=%7b%22RatingS%22%3a%22TMDb%22%2c%22add_tags%22%3atrue%2c%22certprefix%22%3a%22Rated%20%22%2c%22enable_fanarttv_artwork%2
2%3atrue%2c%22fanart%22%3atrue%2c%22fanarttv_clientkey%22%3a%22%22%2c%22fanarttv_language%22%3a%22de%22%2c%22imdbanyway%22%3afalse%2c%22keeporiginaltitle%22%3afalse%2c%22landscape%22%3atrue%2c%22language%22%3a%22de-DE%22%2c%22lastUpdated%22%3a%220%22%2c%22multiple_s
tudios%22%3afalse%2c%22originalUrl%22%3a%22%22%2c%22previewUrl%22%3a%22%22%2c%22searchlanguage%22%3a%22en-US%22%2c%22tmdbcertcountry%22%3a%22de%22%2c%22trailer%22%3afalse%2c%22traktanyway%22%3afalse%7d&title=3%20Engel%20f%c3%bcr%20Charlie%20-%20Volle%20Power

Possible Fix

coding issue

I also see in the log, that the search language is always en-US regardless what I configure (e.g. de-DE ). But searching for english titel doesn’t make a difference

To Reproduce

I am sure I am not the only one with this issue

Screenshots

N/A

Additional context or screenshots (if appropriate)

N/A

Your Environment

Kodi System is a RPi4 with LibreELEC 10.0.0
The Movie Database Python Version 1.5.0+matrix.1
(Former Version 1.4 worked without any trouble )
local language is German — and so is the search configured with de-DE

  • Android

  • iOS

  • tvOS

  • [x ] Linux

  • OSX

  • Windows

  • Windows UWP

  • Operating system version/name: LibreELEC 10.0.0

  • Kodi version:19.1.0

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

Bug report

Description

When updating the library after adding new movies, I received a couple of errors on screen that the add-on has stopped and should look in the event log.
Some movies have been added with correct informations into my library.
When I try to update the information for the other, not recognized movies I will receive the same error again.

There is no difference when I switch the search language from en-US to de-DE or back in the setting of the Movie Scraper Module

Log File snippet

`2021-10-19 22:54:34.069 T:16688 INFO : initializing python engine.
2021-10-19 22:54:34.364 T:16688 INFO : [metadata.themoviedb.org.python]: Find movie with title ‘3 Engel für Charlie — Volle Power’ from year ‘None’
2021-10-19 22:54:34.373 T:16688 ERROR : EXCEPTION Thrown (PythonToCppException) : —>Python callback/script returned the following error<—
— NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class ‘UnboundLocalError’>
Error Contents: local variable ‘search_results’ referenced before assignment
Traceback (most recent call last):
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 185, in
run()
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 172, in run
search_for_movie(params[«title»], params.get(«year»), params[‘handle’], settings)
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 40, in search_for_movie
if not search_results:
UnboundLocalError: local variable ‘search_results’ referenced before assignment
—>End of Python script error report<—

2021-10-19 22:54:34.811 T:16688 WARNING : CPythonInvoker(400, /storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py): the python script «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py» has left several classes in mem
ory that we couldn’t clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-10-19 22:54:34.811 T:16688 INFO : Python interpreter stopped
2021-10-19 22:54:34.813 T:16687 ERROR : GetDirectory — Error getting plugin://metadata.themoviedb.org.python/?action=find&pathSettings=%7b%22RatingS%22%3a%22TMDb%22%2c%22add_tags%22%3atrue%2c%22certprefix%22%3a%22Rated%20%22%2c%22enable_fanarttv_artwork%2
2%3atrue%2c%22fanart%22%3atrue%2c%22fanarttv_clientkey%22%3a%22%22%2c%22fanarttv_language%22%3a%22de%22%2c%22imdbanyway%22%3afalse%2c%22keeporiginaltitle%22%3afalse%2c%22landscape%22%3atrue%2c%22language%22%3a%22de-DE%22%2c%22lastUpdated%22%3a%220%22%2c%22multiple_s
tudios%22%3afalse%2c%22originalUrl%22%3a%22%22%2c%22previewUrl%22%3a%22%22%2c%22searchlanguage%22%3a%22en-US%22%2c%22tmdbcertcountry%22%3a%22de%22%2c%22trailer%22%3afalse%2c%22traktanyway%22%3afalse%7d&title=3%20Engel%20f%c3%bcr%20Charlie%20-%20Volle%20Power

Possible Fix

coding issue

I also see in the log, that the search language is always en-US regardless what I configure (e.g. de-DE ). But searching for english titel doesn’t make a difference

To Reproduce

I am sure I am not the only one with this issue

Screenshots

N/A

Additional context or screenshots (if appropriate)

N/A

Your Environment

Kodi System is a RPi4 with LibreELEC 10.0.0
The Movie Database Python Version 1.5.0+matrix.1
(Former Version 1.4 worked without any trouble )
local language is German — and so is the search configured with de-DE

  • Android

  • iOS

  • tvOS

  • [x ] Linux

  • OSX

  • Windows

  • Windows UWP

  • Operating system version/name: LibreELEC 10.0.0

  • Kodi version:19.1.0

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

Содержание

  1. movie scraper ‘The Movie Database Python’ doesn’t work constant after update #20349
  2. Comments
  3. Bug report
  4. Description
  5. Log File snippet
  6. Possible Fix
  7. To Reproduce
  8. Screenshots
  9. Additional context or screenshots (if appropriate)
  10. Your Environment
  11. Footer
  12. The movie database python error
  13. The movie database python error
  14. Themoviedatabase.org certprefix #232
  15. Comments
  16. Add-on details:
  17. The movie database python error

movie scraper ‘The Movie Database Python’ doesn’t work constant after update #20349

Bug report

Description

When updating the library after adding new movies, I received a couple of errors on screen that the add-on has stopped and should look in the event log.
Some movies have been added with correct informations into my library.
When I try to update the information for the other, not recognized movies I will receive the same error again.

There is no difference when I switch the search language from en-US to de-DE or back in the setting of the Movie Scraper Module

Log File snippet

`2021-10-19 22:54:34.069 T:16688 INFO : initializing python engine.
2021-10-19 22:54:34.364 T:16688 INFO : [metadata.themoviedb.org.python]: Find movie with title ‘3 Engel für Charlie — Volle Power’ from year ‘None’
2021-10-19 22:54:34.373 T:16688 ERROR : EXCEPTION Thrown (PythonToCppException) : —>Python callback/script returned the following error
Error Contents: local variable ‘search_results’ referenced before assignment
Traceback (most recent call last):
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 185, in
run()
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 172, in run
search_for_movie(params[«title»], params.get(«year»), params[‘handle’], settings)
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 40, in search_for_movie
if not search_results:
UnboundLocalError: local variable ‘search_results’ referenced before assignment
—>End of Python script error report tudios%22%3afalse%2c%22originalUrl%22%3a%22%22%2c%22previewUrl%22%3a%22%22%2c%22searchlanguage%22%3a%22en-US%22%2c%22tmdbcertcountry%22%3a%22de%22%2c%22trailer%22%3afalse%2c%22traktanyway%22%3afalse%7d&title=3%20Engel%20f%c3%bcr%20Charlie%20-%20Volle%20Power

Possible Fix

I also see in the log, that the search language is always en-US regardless what I configure (e.g. de-DE ). But searching for english titel doesn’t make a difference

To Reproduce

I am sure I am not the only one with this issue

Screenshots

Additional context or screenshots (if appropriate)

Your Environment

Kodi System is a RPi4 with LibreELEC 10.0.0
The Movie Database Python Version 1.5.0+matrix.1
(Former Version 1.4 worked without any trouble )
local language is German — and so is the search configured with de-DE

Operating system version/name: LibreELEC 10.0.0

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

The text was updated successfully, but these errors were encountered:

Sorry, wrong place for the issue. Issue seems to be fixed in upcoming version 1.5.1 of the plug-in

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Новые темы необходимо создавать только в корневом разделе! В дальнейшем они будут обработаны модераторами.

Если Вы выложили новую версию программы, пожалуйста, сообщите об этом модератору нажав на вашем сообщении кнопку «Жалоба».

Последнее обновление программы в шапке: 27.03.2022

Краткое описание:
Кросс-платформенный медиацентр XBMC.

Описание:
Бесплатный кроссплатформенный медиаплеер и программное обеспечение для организации HTPC с открытым исходным кодом. Графический интерфейс программы позволяет легко управлять видеофайлами, фотографиями и музыкой, находящимися на компьютере, оптическом диске, в интернете или в локальной сети. Может управляться с помощью ПДУ.

  • Установка Netflix в Kodi 19
  • Настройка аддона YouTube
  • Создание анимированной медиатеки
  • Переключение интерфейса KODI 17 на русский язык
  • Добавление кнопок в главное меню Kodi 17
  • Инструкция по установке
  • Инструкция по настройке
  • Поставил Kodi. Что делать теперь?
  • Как организовать медиатеку
  • Что такое репозиторий?
  • Список поддерживаемых чипов в XBMC v13 «Gotham» (аппаратное декодирование)
  • Увеличение буферизации до 150 мб + Дополнение
  • Получение полного доступа к внешним накопителям с помощью Xposed
  • В настройках Elementum прокси
  • Edem (IEdem, IlookTV) converter GUI for KODI (v0.1-20200620)
  • Как управлять kodi при помощи смарт часов под управлением Tizen
  • Для тех у кого вылетает коди при выборе предложенных вариантов ввода текста
  • Версия 19 не видит расшаренные папки на Win10
  • Плагин Elementum не работает в Kodi версии 19 и выше под Android версии 10 и выше
  • Воспроизведение и управление пультом DVD из папок на харде и серваке + Дополнение

Требуется Android: 5.0 и выше
Русский интерфейс: Да

Android 4.2+:
Версия: 16.1 Jarvis for Windows Kodi (Пост _SERGEYX_ #56018605)
Версия: 16.0 Jarvis Kodi (Пост fack1900 #47300196)
Версия: 16.0 Jarvis x86 Kodi (Пост ROMANFIONOV #47315630)
Версия: 15.2 final Kodi (Пост grey684 #43824098)
Версия: 15.2 + кэш Kodi (Пост fack1900 #44038040)
Версия: 14.2 (x86) Stable kodi-14.2-Helix-x86.apk ( 61.12 МБ )

Версия: 14.2 (windows) Stable kodi-14.2-Helix.exe ( 67.82 МБ )

Версия: 15.1.1 Kodi (Пост grey684 #42405075)
Версия: 15.1 + кэш Kodi (Пост fack1900 #42280136)
Версия: 15 + кэш Kodi (Пост fack1900 #41793816)
Версия: 15.0 + кэш KODI (XBMC) (Пост fack1900 #41260543)
Версия: 14.2 (arm) Stable kodi-14.2-Helix-armeabi-v7a.apk ( 59.74 МБ )

Версия: 13 Stable XBMC (Пост #31290789)
Версия: 13 XBMC (Пост #31210770)
Версия: 12.2 https://4pda.to/forum/dl/post/2915114/xbmc-12.2-Frodo-armeabi-v7a.apk
Версия: 12.1 xbmc-12.1-Frodo-armeabi-v7a.apk
Версия: 12.0 http://mirrors.xbmc.org/releases/android/x. armeabi-v7a.apk
NEON Devices (Nexus 7 / Tegra3 / Newer Samsung Devices): xbmcapp-armeabi-v7a-debug-08-22-full-neon.apk
Non-NEON Devices (Tegra2 / A500 / A100 / Thrive): xbmcapp-armeabi-v7a-debug-08-22-no-neon.apk
Версия: n/axbmcapp_armeabi_v7a_debug_20120714.apk ( 39.01 МБ )

Сообщение отредактировал Chudmin — 19.09.22, 13:27

Источник

The movie database python error

Lopsho
Junior Member

Ha, I had this exact same error yesterday. But it was my fault as I tested something for another team member, then forgot to disable the Proxy settings.

So can you check your Proxy Server settings and disable it. https://kodi.wiki/view/Settings/System/Internet_access

Are you also seeing a pop-up stating «Could not connect to Server» or similar?

Lopsho
Junior Member

(2021-02-28, 02:19) Karellen Wrote: So can you check your Proxy Server settings and disable it. https://kodi.wiki/view/Settings/System/Internet_access

Are you also seeing a pop-up stating «Could not connect to Server» or similar?

Proxy was and is still disabled, the only pop-up I get is «Check the log for more information.» for The Movie Database Python, and then it starts scanning the next movie which after several minutes gives me the same pop-up.

Of course that would have been too easy.

Are you using a VPN or any sort of service similar? Can Kodi connect to the internet? Try installing an add-on from the official Repository. Install Global Search from the Programs section.

Источник

Themoviedatabase.org certprefix #232

Add-on details:

  • General
    • Add-on name: metadata.themoviedb.org
    • Add-on ID: metadata.themoviedb.org
    • Version number: 5.2.2
    • Kodi/repository version:
      Hello, i have see that the certprefix/Rated have no translate. In german is not called Rated it called FSK.
      Is it possible to add a string the translate it for the other languages?
      In my case, i have change the line temporar in settings.xml from
      Rated
      to
      FSK
      and now i have FSK instead of Rated.
      And i have see, that are more settings have no translation.

The text was updated successfully, but these errors were encountered:

I am not sure how much luck you will have with the change. But if you use one of the other scrapers, there is a setting where you can enter the prefix you prefer.

Both are available in the repo.

I have also see, that i can change the prefix in themoviedatabse scraper for TVshows. Universal Movie Scraper is a nice scraper but have a small error with the movie family guy Something, Something, Something, Dark Side. It’s use the IMDB TT instead the Movieid from TMDB and did not load the Movie Infos. So i must use TheMovieDatabase Scraper for the file.
The Movie Database Python load the english infos and covers for the Movies. But i have set all to German.

This is the last support you will receive here on Github. Any more questions, please ask them on the forum.

It’s use the IMDB TT instead the Movieid from TMDB and did not load the Movie Infos.

Sorry I don’t know what you mean by this, and I cannot help without a debuglog

The Movie Database Python load the english infos and covers for the Movies. But i have set all to German.

It works for me. There are no German posters, so of course you will get the English poster, but the info is all German for me.
Make sure you set the language in Videos>Files>YourSource>Context Menu>Change Content and not in the add-ons section.

Источник

The movie database python error

Python Scraper for Movies

Site used : https://www.themoviedb.org/
Status: Working for Kodi v18 and later.

About
Python TheMovieDB scraper for Movies is a Python scraper (wiki) for Movies and Movie Collections used by KODI.
The scraper relies on matching your folder and filenames to movie titles at TheMovieDB site. For this reason, it is important to ensure your folders and files are correctly and cleanly named for an accurate scrape.

It is available in the official Kodi repo for Leia.

This scraper will download the following:

Known Issues
Nil known.

Download
This scraper is available from the Kodi Official Repository for v18 and later
Find it in Settings>Add-ons>Install from repository>Information providers>Movie information

Guides
Visit the wiki for an explanation of the scraper settings and other features.
The Movie DB Python (wiki)

The following links may assist with setting up your library:
How to Create your Video Library (wiki)

docwra
Posting Freak

Couple of things after testing:

— Maybe the old XML scraper should be renamed from «The Movie Database» to «The Movie Database XML» so its obvious which one is being used.
— Choosing GB as the certification rating doesn’t seem to work. I still get US ratings.
— Basic settings on the scraper settings should really show the Language and (and possibly preferred country certification) I think.

— More of a feature request, but can the IMDB and TMDB ratings be scraped independently to something like ratingIMDB and ratingTMDB database fields? It would reduce the scraper options. Maybe even add rotten tomatoes as well. Skins would look awesome with these 3 ratings. I don’t see why there needs to be endless options for these.
— Would also love to see the IMDB top250 added to this

Everything else worked as expected with my simple test library, other than the known issues already mentioned.

Источник

Универсальный способ обеспечить работу любого медиасервера с TMDB:
Если у Вас роутер выступает в качестве локального DNS-сервера, потребуется сделать 3 статические DNS-записи, указанные ниже, на нём (думаю, что каждый роутер должен давать такую возможность, соответственно как это сделать — загуглите для своей модели роутера).

Если у Вас отдельный DNS-сервер как пакет Synology, AdGuard Home, PiHole или вообще Bind, то я уверен, что Вы знаете как сделать в них статические DNS-записи, поэтому сделайте 3 статические DNS-записи, указанные ниже, в них.

1) api.tmdb.org 54.192.99.23
2) image.tmdb.org 138.199.37.231
3) images.tmdb.org 54.192.99.19

Не требуются VPN и смена DNS-сервера провайдера на какой-либо из выше указанных.
На сайт themoviedb.org Вы не зайдёте, но, я думаю, что Вам это и не нужно.

Работает на 21:33 25.01.2023 и думаю, что будет работать долго, тк перестанет это работать только в случае, если сервис tmdb откажется от использования указанных ip-адресов, а это, как мне кажется, никогда не произойдёт.

Posts: 264

Joined: May 2012

Reputation:
0


2021-09-21, 08:34
(This post was last modified: 2021-09-23, 23:36 by Stildawn.)

Hi All

On a new Kodi setup I am having issues with scrapping in my movies.

Debug here: https://paste.kodi.tv/olisifigiza — I hope this is the right one as it crashed back to Android TV main menu.

What happens:

1. I refresh my movie source
2. Progress bar sits at 0% for a few minutes, then works up to 100%
3. As soon as the first movie title appears in the progress bar, Kodi complete crashes back to Android TV main menu

A previous try it got into scrapping individual movies, but kept coming up with the below error on each movie:

Quote:The Movie Database Phyton
Failed to reach remote site
Reason: [SSL:CERTIFICATE_VER ….. and then it cuts off the message likely because the skin can’t display it all.

I can’t get back to that point again as Kodi crashes before that point.

Hopefully the debug has something in it, as like I said it crashed so I can’t confirm its uploading the right run.

I can confirm that I can download and install add-ons from the repo.

Any ideas?

Thanks

Posts: 18,410

Joined: Apr 2017

Reputation:
1,089

Unfortunately that log shows nothing out of the ordinary.

We need the log that captures the symptoms you describe above, either that ssl error or the crashing.

If you restart Kodi to use the Log Uploader addon, then you need to also upload kodi.old.log. which would be the one that captured the crash, not the new log due to restarting kodi. You need to enable this in the settings of the uploader addon then upload both.

Posts: 264

Joined: May 2012

Reputation:
0

(2021-09-21, 08:48)Karellen Wrote: Unfortunately that log shows nothing out of the ordinary.

We need the log that captures the symptoms you describe above, either that ssl error or the crashing.

If you restart Kodi to use the Log Uploader addon, then you need to also upload kodi.old.log. which would be the one that captured the crash, not the new log due to restarting kodi. You need to enable this in the settings of the uploader addon then upload both.

Yeah thats what I tried, obviously got the wrong one.

Where are the logs saved in Android TV, might be easier to just copy it manually from Xplore.

Posts: 18,410

Joined: Apr 2017

Reputation:
1,089

(2021-09-21, 08:57)Stildawn Wrote: Where are the logs saved in Android TV, might be easier to just copy it manually from Xplore.

https://kodi.wiki/view/Log_file

Posts: 264

Joined: May 2012

Reputation:
0


2021-09-21, 11:55
(This post was last modified: 2021-09-23, 23:36 by Stildawn.)

Ok I have these now had to split the logs:

What I am sure is the one with the crash in it based on time stamps:
Part 1 — https://paste.kodi.tv/pawufowahea.kodi
Part 2 — https://paste.kodi.tv/edaduqeqiqa.kodi

Not sure if you need this, but this is the first run again after the crash: 
Part 1 — https://paste.kodi.tv/uvupajiniva.kodi
Part 2 — https://paste.kodi.tv/ihahudisipa.kodi

Hopefully that helps

Posts: 264

Joined: May 2012

Reputation:
0

Any idea on this?

Would going back to the old XML one work?

Posts: 18,410

Joined: Apr 2017

Reputation:
1,089

(2021-09-22, 08:13)Stildawn Wrote: Any idea on this?

No.
I had a look at the logs earlier, and again now, but I see absolutely nothing wrong. But I don’t see you scraping the library either which, from your first post, is where the problem is.

I see the second part of the first log abruptly stops, but there is nothing to indicate a problem. It could be that part of the log was not dumped from memory into the file if you did not shut down, or it could be a sudden crash. I can’t tell.

Hopefully someone with more Android knowledge might see something.

Or provide another log which clearly captures a Library Update.

Posts: 264

Joined: May 2012

Reputation:
0

Is there a way to generate a crash log.

Posts: 264

Joined: May 2012

Reputation:
0

Hi All

So I did a complete uninstall and reinstall of Kodi, set up the Movies sources again and scraped successfully.

However now I am getting the same issue but with TV Shows, set it scraping and then after awhile it crashes to Android TV main menu.

Difference is that this time it doesn’t crash instantly, it starts doing shows and then crashes as somepoint.

I managed to grab a log which should have the crash in it, but its too large for pastebin so I zipped it here: https://drive.google.com/file/d/1StkFdCQ…sp=sharing

Hopefully this works?

Posts: 264

Joined: May 2012

Reputation:
0

Hi All, did the log above catch any issues?

Posts: 18,410

Joined: Apr 2017

Reputation:
1,089

(2021-09-26, 02:12)Stildawn Wrote: Hi All, did the log above catch any issues?

Unfortunately I still don’t see anything in the log that can point to a problem.
I can see the log suddenly stops, but no indication why….

Does it always crash while scraping the same tv show? In the log it has just started to scrape The Walking Dead. What if you scrape that individually, rather than as part of a Library Update? Does it still crash.

Which tv show is this image from… https://image.tmdb.org/t/p/original/oVnJ…y1XDO0.jpg

Posts: 264

Joined: May 2012

Reputation:
0

I’m guessing that image is the blacklist.

No it doesn’t seem to crash on any thing in particular.

I have it all scraped now so hopefully it manages to get through short updates when required. Still don’t know the actual problem though.

It’s running on a philips android tv, I was thinking it might be a cpu power issue but kodi runs so well and smooth that I don’t think the philips TV cpu is overly struggling.

Содержание

  1. movie scraper ‘The Movie Database Python’ doesn’t work constant after update #20349
  2. Comments
  3. Bug report
  4. Description
  5. Log File snippet
  6. Possible Fix
  7. To Reproduce
  8. Screenshots
  9. Additional context or screenshots (if appropriate)
  10. Your Environment
  11. Footer
  12. The movie database python error
  13. The movie database python error
  14. Themoviedatabase.org certprefix #232
  15. Comments
  16. Add-on details:
  17. The movie database python error

movie scraper ‘The Movie Database Python’ doesn’t work constant after update #20349

Bug report

Description

When updating the library after adding new movies, I received a couple of errors on screen that the add-on has stopped and should look in the event log.
Some movies have been added with correct informations into my library.
When I try to update the information for the other, not recognized movies I will receive the same error again.

There is no difference when I switch the search language from en-US to de-DE or back in the setting of the Movie Scraper Module

Log File snippet

`2021-10-19 22:54:34.069 T:16688 INFO : initializing python engine.
2021-10-19 22:54:34.364 T:16688 INFO : [metadata.themoviedb.org.python]: Find movie with title ‘3 Engel für Charlie — Volle Power’ from year ‘None’
2021-10-19 22:54:34.373 T:16688 ERROR : EXCEPTION Thrown (PythonToCppException) : —>Python callback/script returned the following error
Error Contents: local variable ‘search_results’ referenced before assignment
Traceback (most recent call last):
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 185, in
run()
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 172, in run
search_for_movie(params[«title»], params.get(«year»), params[‘handle’], settings)
File «/storage/.kodi/addons/metadata.themoviedb.org.python/python/scraper.py», line 40, in search_for_movie
if not search_results:
UnboundLocalError: local variable ‘search_results’ referenced before assignment
—>End of Python script error report tudios%22%3afalse%2c%22originalUrl%22%3a%22%22%2c%22previewUrl%22%3a%22%22%2c%22searchlanguage%22%3a%22en-US%22%2c%22tmdbcertcountry%22%3a%22de%22%2c%22trailer%22%3afalse%2c%22traktanyway%22%3afalse%7d&title=3%20Engel%20f%c3%bcr%20Charlie%20-%20Volle%20Power

Possible Fix

I also see in the log, that the search language is always en-US regardless what I configure (e.g. de-DE ). But searching for english titel doesn’t make a difference

To Reproduce

I am sure I am not the only one with this issue

Screenshots

Additional context or screenshots (if appropriate)

Your Environment

Kodi System is a RPi4 with LibreELEC 10.0.0
The Movie Database Python Version 1.5.0+matrix.1
(Former Version 1.4 worked without any trouble )
local language is German — and so is the search configured with de-DE

Operating system version/name: LibreELEC 10.0.0

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

The text was updated successfully, but these errors were encountered:

Sorry, wrong place for the issue. Issue seems to be fixed in upcoming version 1.5.1 of the plug-in

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Новые темы необходимо создавать только в корневом разделе! В дальнейшем они будут обработаны модераторами.

Если Вы выложили новую версию программы, пожалуйста, сообщите об этом модератору нажав на вашем сообщении кнопку «Жалоба».

Последнее обновление программы в шапке: 27.03.2022

Краткое описание:
Кросс-платформенный медиацентр XBMC.

Описание:
Бесплатный кроссплатформенный медиаплеер и программное обеспечение для организации HTPC с открытым исходным кодом. Графический интерфейс программы позволяет легко управлять видеофайлами, фотографиями и музыкой, находящимися на компьютере, оптическом диске, в интернете или в локальной сети. Может управляться с помощью ПДУ.

  • Установка Netflix в Kodi 19
  • Настройка аддона YouTube
  • Создание анимированной медиатеки
  • Переключение интерфейса KODI 17 на русский язык
  • Добавление кнопок в главное меню Kodi 17
  • Инструкция по установке
  • Инструкция по настройке
  • Поставил Kodi. Что делать теперь?
  • Как организовать медиатеку
  • Что такое репозиторий?
  • Список поддерживаемых чипов в XBMC v13 «Gotham» (аппаратное декодирование)
  • Увеличение буферизации до 150 мб + Дополнение
  • Получение полного доступа к внешним накопителям с помощью Xposed
  • В настройках Elementum прокси
  • Edem (IEdem, IlookTV) converter GUI for KODI (v0.1-20200620)
  • Как управлять kodi при помощи смарт часов под управлением Tizen
  • Для тех у кого вылетает коди при выборе предложенных вариантов ввода текста
  • Версия 19 не видит расшаренные папки на Win10
  • Плагин Elementum не работает в Kodi версии 19 и выше под Android версии 10 и выше
  • Воспроизведение и управление пультом DVD из папок на харде и серваке + Дополнение

Требуется Android: 5.0 и выше
Русский интерфейс: Да

Android 4.2+:
Версия: 16.1 Jarvis for Windows Kodi (Пост _SERGEYX_ #56018605)
Версия: 16.0 Jarvis Kodi (Пост fack1900 #47300196)
Версия: 16.0 Jarvis x86 Kodi (Пост ROMANFIONOV #47315630)
Версия: 15.2 final Kodi (Пост grey684 #43824098)
Версия: 15.2 + кэш Kodi (Пост fack1900 #44038040)
Версия: 14.2 (x86) Stable kodi-14.2-Helix-x86.apk ( 61.12 МБ )

Версия: 14.2 (windows) Stable kodi-14.2-Helix.exe ( 67.82 МБ )

Версия: 15.1.1 Kodi (Пост grey684 #42405075)
Версия: 15.1 + кэш Kodi (Пост fack1900 #42280136)
Версия: 15 + кэш Kodi (Пост fack1900 #41793816)
Версия: 15.0 + кэш KODI (XBMC) (Пост fack1900 #41260543)
Версия: 14.2 (arm) Stable kodi-14.2-Helix-armeabi-v7a.apk ( 59.74 МБ )

Версия: 13 Stable XBMC (Пост #31290789)
Версия: 13 XBMC (Пост #31210770)
Версия: 12.2 https://4pda.to/forum/dl/post/2915114/xbmc-12.2-Frodo-armeabi-v7a.apk
Версия: 12.1 xbmc-12.1-Frodo-armeabi-v7a.apk
Версия: 12.0 http://mirrors.xbmc.org/releases/android/x. armeabi-v7a.apk
NEON Devices (Nexus 7 / Tegra3 / Newer Samsung Devices): xbmcapp-armeabi-v7a-debug-08-22-full-neon.apk
Non-NEON Devices (Tegra2 / A500 / A100 / Thrive): xbmcapp-armeabi-v7a-debug-08-22-no-neon.apk
Версия: n/axbmcapp_armeabi_v7a_debug_20120714.apk ( 39.01 МБ )

Сообщение отредактировал Chudmin — 19.09.22, 13:27

Источник

The movie database python error

Lopsho
Junior Member

Ha, I had this exact same error yesterday. But it was my fault as I tested something for another team member, then forgot to disable the Proxy settings.

So can you check your Proxy Server settings and disable it. https://kodi.wiki/view/Settings/System/Internet_access

Are you also seeing a pop-up stating «Could not connect to Server» or similar?

Lopsho
Junior Member

(2021-02-28, 02:19) Karellen Wrote: So can you check your Proxy Server settings and disable it. https://kodi.wiki/view/Settings/System/Internet_access

Are you also seeing a pop-up stating «Could not connect to Server» or similar?

Proxy was and is still disabled, the only pop-up I get is «Check the log for more information.» for The Movie Database Python, and then it starts scanning the next movie which after several minutes gives me the same pop-up.

Of course that would have been too easy.

Are you using a VPN or any sort of service similar? Can Kodi connect to the internet? Try installing an add-on from the official Repository. Install Global Search from the Programs section.

Источник

Themoviedatabase.org certprefix #232

Add-on details:

  • General
    • Add-on name: metadata.themoviedb.org
    • Add-on ID: metadata.themoviedb.org
    • Version number: 5.2.2
    • Kodi/repository version:
      Hello, i have see that the certprefix/Rated have no translate. In german is not called Rated it called FSK.
      Is it possible to add a string the translate it for the other languages?
      In my case, i have change the line temporar in settings.xml from
      Rated
      to
      FSK
      and now i have FSK instead of Rated.
      And i have see, that are more settings have no translation.

The text was updated successfully, but these errors were encountered:

I am not sure how much luck you will have with the change. But if you use one of the other scrapers, there is a setting where you can enter the prefix you prefer.

Both are available in the repo.

I have also see, that i can change the prefix in themoviedatabse scraper for TVshows. Universal Movie Scraper is a nice scraper but have a small error with the movie family guy Something, Something, Something, Dark Side. It’s use the IMDB TT instead the Movieid from TMDB and did not load the Movie Infos. So i must use TheMovieDatabase Scraper for the file.
The Movie Database Python load the english infos and covers for the Movies. But i have set all to German.

This is the last support you will receive here on Github. Any more questions, please ask them on the forum.

It’s use the IMDB TT instead the Movieid from TMDB and did not load the Movie Infos.

Sorry I don’t know what you mean by this, and I cannot help without a debuglog

The Movie Database Python load the english infos and covers for the Movies. But i have set all to German.

It works for me. There are no German posters, so of course you will get the English poster, but the info is all German for me.
Make sure you set the language in Videos>Files>YourSource>Context Menu>Change Content and not in the add-ons section.

Источник

The movie database python error

Python Scraper for Movies

Site used : https://www.themoviedb.org/
Status: Working for Kodi v18 and later.

About
Python TheMovieDB scraper for Movies is a Python scraper (wiki) for Movies and Movie Collections used by KODI.
The scraper relies on matching your folder and filenames to movie titles at TheMovieDB site. For this reason, it is important to ensure your folders and files are correctly and cleanly named for an accurate scrape.

It is available in the official Kodi repo for Leia.

This scraper will download the following:

Known Issues
Nil known.

Download
This scraper is available from the Kodi Official Repository for v18 and later
Find it in Settings>Add-ons>Install from repository>Information providers>Movie information

Guides
Visit the wiki for an explanation of the scraper settings and other features.
The Movie DB Python (wiki)

The following links may assist with setting up your library:
How to Create your Video Library (wiki)

docwra
Posting Freak

Couple of things after testing:

— Maybe the old XML scraper should be renamed from «The Movie Database» to «The Movie Database XML» so its obvious which one is being used.
— Choosing GB as the certification rating doesn’t seem to work. I still get US ratings.
— Basic settings on the scraper settings should really show the Language and (and possibly preferred country certification) I think.

— More of a feature request, but can the IMDB and TMDB ratings be scraped independently to something like ratingIMDB and ratingTMDB database fields? It would reduce the scraper options. Maybe even add rotten tomatoes as well. Skins would look awesome with these 3 ratings. I don’t see why there needs to be endless options for these.
— Would also love to see the IMDB top250 added to this

Everything else worked as expected with my simple test library, other than the known issues already mentioned.

Источник

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


Closed

Mibrechou opened this issue

Nov 19, 2017

· 91 comments


Closed

Themoviedb doesn’t work anymore

#1108

Mibrechou opened this issue

Nov 19, 2017

· 91 comments

Comments

@Mibrechou

Hello

I have tried Today to update my Movie Database and a Message informing about no Connexion is displaying immédiatly.

I have used this function 2 Days ago without Problem.

I have checked with Kodi 17.6 without Problem (except Fanart…. etc…)

Coud you check to verify ?

Regards

JP

@JonRStorey

@ptijoe34

Hi, I’ve tested : not working either.
Everything is ok with universal media scraper, but so slow!!!

@paulyy88

@iatacs19

I am also having this issue, tested on 2 different Shields on different networks.

@JonRStorey

I updated universal media scraper moviedb Add-ons and its working now

@Mibrechou

«universal media scraper» :

  • is very slow
  • no fanart
  • no Jacket

@trotter4

Also having some trouble with moviedb scraper. Have tried editing the updated addon.xml as suggested earlier in this thread (#944) with no success. Any suggestions?

@Skydante

Hello,

What do you mean by «I updated universal media scraper moviedb Add-ons» JonRStorey ? I use Universal Movie Scraper but it doesn’t work anymore if I select the moviedb Add-on, even with the latest version (2.8.9)

@sns0729

I’m having the same problem. The version shown for TMDB scraper is different from the latest that shows in Kodi. Universal Movie Scraper stopped working as well (latest version).

@JonRStorey

I updated to universal scraper 2.8.9 and themoviedb to version 673.9.5 and it started working again

@dabl2

Hmm the last update to the Google Play version in July was for the The Movie Database scraper so it looks like it might be time for another fix :)

https://github.com/koying/SPMC/releases

16.7.1
@koying koying released this on Jul 30 · 7304 commits to spmc-krypton since this release

FIX: TMDB scrapper
….

EDIT: Per JonRStorey, thought was seeing same, however the ‘cannot connect’ messages continue when attempting to use The Movie Database as a provider with SPMC 16.7.1 on an Nvidia Shield 2017 16 GB

@Mibrechou

I have checked themoviedb version. it’s allready version 673.9.5 and not working…

@ptijoe34

Same thing for me. I’m on 673.9.5 for the moviedb and Universal media scraper on 2.8.9 and it’s not working neither… please fix the problem.

@Mibrechou

Note : by going back to Kodi 17.6, the Problem can be solved…

But I will wait some Days : SPMC was better before the Problem occur.

@ThomMark

SPMC not working for me either, fully updated and even tested on a fresh install, all to no avail.
Kodi 17.6 is confirmed working, but deffinatily not on SPMC, which I use more.

Please fix 😉

@ThomMark

Right, I’ve been at this all day and I’m 99.9% certain that it can’t be fixed manually, I think a new version of SPMC is required to fix the movie database. If I’m wrong, please share.

@mygoo0205

Same issue, TMDB not working. TVDB work perfectly on SPMC.
Regarding Kodi, no issues.
Please we need a patch to fix SPMC.
Thanks

@dabl2

@ThomMark

The issue is with 16.7.1 from June 17.
The release you make reference to is a BETA/Test release I believe mate.

@dabl2

Yep thanks, was just trying to understand if the problem was limited to the 16.7.1 SPMC release

@mygoo0205

For the moment the issue is on 16.7.1 SPMC.

@ThomMark

OK guys, here is what I have done so far.
I copied my com.semperpax.spmc16 to my PC (Backup)
I installed SPMC-spmc-krypton-2a41374-armeabi-v7a.apk (Release Date: 2017-11-20 V17.6-alpha1)
Download Here: http://download.semperpax.com/spmc/android-arm/SPMC-spmc-krypton-2a41374-armeabi-v7a.apk
Renamed my com.semperpax.spmc16 (to) com.semperpax.spmc17
Once I launched the new SPMC it migrated my data and everything is working perfect.
I was skeptical about installing a BETA version, but so far I do not notice any difference.
The scraper program is working perfect again.

I hope this helps some of you, or you could just wait for a patch/update for the 16.7.1 version.

For now, I’m happy! :)

@permster

@ThomMark

@Mibrechou

Forget SPMC-spmc-krypton-2a41374-armeabi-v7a.apk

WRONG FANART !!!!!!!

Off course with it you can forget kodi….

Therefore : Thank you for Information

@mygoo0205

Yes I confirm, wrong Fanart or nous Fanart with SPMC Krypton (tvdb scraper) too bad

@ThomMark

Forget SPMC-spmc-krypton-2a41374-armeabi-v7a.apk

WRONG FANART !!!!!!!

OK, I am confused, I have downloaded some latest movies tonight using this, and all the art work is correct.
Not tried TV series though.

I am sad now, as I felt like the first man on the moon when I upgraded earlier lol

@mygoo0205

Yes I confirm, wrong Fanart or no Fanart with SPMC Krypton (tvdb scraper) too bad

@Mibrechou

Hi ThomMark

Don’t be confused, you did a goog Job to help us

Regards

@dabl2

Not to confuse matters further but when I saw ThomMark’s first post I also thought he might be the first man on the moon.

In attempting to catch up with the state of this project I just made it through the Test builds for SPMC 17 (Krypton) #936 thread.

There were posts in that thread from user thecubasekid many moons ago about upgrading a v16 setup to v17 and follow ups indicating that the v17 installer creates a separate instance on purpose and that if one wants to have their v16 set-up in v17 it is necessary to copy the addons and userdata folders from the v16 install and replace both folders in the v17 install. Further, for simple setups many addons will likely need to be re-enabled if not downloaded again.

Perhaps the fanart errors with the ThomMark method are related to this?

@1aranzant

I do get some data with the newer version of tmdb, but no cast, no art, …

@Phanatical

I’m having the same issue as above. After this manual update, Moviedb somewhat works now but still does not scrape any artwork. Just data. Universal scraper is halfway broken too. It’ll only scrape some artwork. Don’t know what’s going on, all this stuff worked fine a couple weeks ago.

@Prodeje

how do we get more attention on this? This seems to be the highest priority item when looking at the issues log.

@koying

@manjinanz

@koying It kinda worked. My new content is showing now but the movie poster looks like a screengrab from the movie rather then the actual movie poster.

Edit: When I go to the movie and select manage, and try to change artwork, no images are available except for the thumbnail which looks the same as mentioned above. Refreshing doesnt fix. And new movies also missing movie ratings.

@grummel2005

wherefore the bz2 files are???

@r2tito

@koying same as manjinanz, movie data is scraping correctly but the artwork isn’t; and trying to change the artwork isn’t working either

Edit: updating to 16.7.2 isn’t working either

@Grandmasterseven

@FMaili

Hi @ALL,
how about the Universal Scrapper? I prefer that one as it additionally adds actors and directors.
Right now both scrapper are good for nothing, even with the 2 zip files installed
Thx in advance!

@r2tito

@Grandmasterseven the metadata.common file fixed the posters and fanart; it’s still not scraping Disc and Logo art, but is better than nothing, thanks

@grummel2005

@Dorko

What version of 16.7.2 build should I use for the Nvidia shield and how can I install it?

@koying

@2WhlWzrd

SPMC-16.7.2-spmc-74d1be1-armeabi-v7a
Working great again.

Thank you.

@Prodeje

so does this fully resolve the issue? Does the android TV play store version (nvidia shield) have this fixed in it?

@Ulver84

Which one is the correct one to use on the nvidia shield TV? =)
SPMC-16.7.2-spmc-74d1be1-armeabi-v7a_launcher.apk
SPMC-16.7.2-spmc-74d1be1-armeabi-v7a.apk

@Dorko

I installed SPMC-16.7.2-spmc-74d1be1-armeabi-v7a and TMDB seems to be working again!
Many thanks

What is the launcher.apk? Is this additionally ?

@koying

@ThomMark

Hi Guys

I have just noticed that the same issues exist with the Adult Universe Scraper .
Does anyone happy to have a fix for that one also?

@LilSnoop40

can someone advise please, i have tried the SPMC direct from the google play store on my NVIDIA Shield and i get the python error about 2.25 i think. so i downloaded this version and still happeningSPMC-16.7.2-spmc-74d1be1-aarch64.apk can someone please point me in the right direction? i read you could edit and xml file but not sure on that one?

Thank you

@r2tito

@LilSnoop40 just to let you know… ; I was having the same issue… until I decided to do a new installation; first I cleaned the app cache on android settings; then I cleared the app data and the uninstalled the app completely; rebooted the shield and installed spmc from the play store… then let spmc update all the addons… and it didn’t have any python errors; this worked for me 1/3 times

@LilSnoop40

ok, i just did something similar than after i had all addons installed that i wanted i was looking to possibly change the skin and i got the error again. is there a fix for this? i made a back using ADBLink, then went to restore my fire stick using the backup and it wouldn’t gave me the python error. wonder what i am doing wrong? thanks

@r2tito

@LilSnoop40 i understand what you’re saying, and i had that same problem too, installing the titan Skin after a fresh install; even on one time the skin was not appearing on the kodi repo; i don’t know exactly why or how did it fixed; i just redo the entire install again and again until it finally fixed itself; my only guess is that when it’s unpacking the apk and installing something goes wrong sometimes, but like i said, i don’t know how or why

@Skydante

@tankalf

Still here, scraper doesn’t work anymore… Nvidia Shield user

@Fotospecht

Themoviedb isn’t working since a few days.
Please reopen this issue or create a new one.

@jamuir

I just installed kodi on ubuntu by following the instructions here:

https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux

I hit this issue (i.e. TheMovieDB server would not respond).

However, I just updated the TheMovieDB add-on from inside Kodi, and now it is working.

@muhammedchand

Всем привет!!!

The Movie Database (TMDB) заблокировали на российском сегменте интернета. Это сделали хозяева сайта. Из-за этого перестали работать Synology Video Station, KODI и многие другие, которые получали с этого ресурса данные. Но есть простое решение!!!

!!! Решение. Больше не работает без VPN, так как картинки и постеры к фильмам закрыли на фаерволе домен image.tmdb.org. Другого способа нет и не будет, пока на той стороне не откроют доступ.

Обычно блокировка ресурсов осуществляется на уровне фаерволов и им подобных решений. Но The Movie Database (TMDB) решили поступить хитрее и заблокировали доступ к своему ресурсу для российского сегмента интернета на уровне DNS:

Решение очень простое. Нужно прописать на сервере, где идет запрос к этому сервису api.themoviedb.org другие DNS сервера. Тут нужно отметить, что Яндекс DNS, гугл и CloudFire не подойдут, так как они все используют один и тот же источник DNS. Нужен альтернативный. Я давно пользуюсь Adguar и поэтому сразу выбрал этого поставщика DNS на своем сервере

Как видно сразу все работает. Можно вписать на сервер эти DNS сервера 9.9.9.9 и все сразу заработает

Если вы пользуетесь Adguard Home то там можно добавить следующее в настройках DNS:

#themoviedb domen
[/themoviedb.org/]9.9.9.9
#tmdb.org domen
[/tmdb.org/]9.9.9.9

Это будет означать что сам домен и *.themoviedb.org будут запрашиваться у DNS сервера 9.9.9.9. У себя я именно так и сделал.

Начиная с 01.09.2022 нужно дополнительно добавить tmdb.org через 9.9.9.9.

Если вы не хотите пользоваться Adguard, а хотите пользоваться другим, то через команду nslookup api.themoviedb.org IP-DNS-сервера (показано на скриншотах выше) вы можете проверить резолвится ли через ваш DNS сервер этот сервис и если да, прописать его на сервере.

Один из списков разных DNS серверов.

На этом все, желаю удачи!!!

I am trying to analyze the movie database using python, downloaded from imdb. While trying to generate some plots, I am running into errors which confuses me.
I am trying to generate a matrix of small figures which can show me any hidden pattern etc. Here is the code:

fig, axes = plt.subplots(nrows=4, ncols=6, figsize=(12, 8), 
                         tight_layout=True)

bins = np.arange(1950,2012,3)
for ax, genre in zip(axes.ravel(), movieGenre):
    ax.hist(movieDF[movieDF['%s'%genre]==1].year, bins=bins, histtype='stepfilled', normed=True, color='r', alpha=.3, ec='None')
    ax.hist(movieDF.year, bins=bins, histtype='stepfilled', ec='None', normed=True, zorder=0, color='grey')
    ax.annotate(genre, xy=(1955, 3e-2), fontsize=14)
    ax.xaxis.set_ticks(np.arange(1950, 2013, 30))
    ax.set_yticks([])
    ax.set_xlabel('Year')

The first hist isn’t working, but the second one is working when I am commenting out the first one. Here is the traceback:

 KeyError                                  Traceback (most recent call last)
<ipython-input-158-c2e7c2737372> in <module>()
      4 bins = np.arange(1950,2012,3)
      5 for ax, genre in zip(axes.ravel(), movieGenre):
----> 6     ax.hist(movieDF[movieDF['%s'%genre]==1].year, bins=bins, histtype='stepfilled', normed=True, color='r', alpha=.3, ec='None')
      7     ax.hist(movieDF.year, bins=bins, histtype='stepfilled', ec='None', normed=True, zorder=0, color='grey')
      8     ax.annotate(genre, xy=(1955, 3e-2), fontsize=14)

/Users/dt/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/axes.pyc in hist(self, x, bins, range, normed, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, **kwargs)
   8247         # Massage 'x' for processing.
   8248         # NOTE: Be sure any changes here is also done below to 'weights'
-> 8249         if isinstance(x, np.ndarray) or not iterable(x[0]):
   8250             # TODO: support masked arrays;
   8251             x = np.asarray(x)

/Users/dt/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/core/series.pyc in __getitem__(self, key)
    477     def __getitem__(self, key):
    478         try:
--> 479             result = self.index.get_value(self, key)
    480 
    481             if not np.isscalar(result):

/Users/dt/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pandas/core/index.pyc in get_value(self, series, key)
   1169 
   1170         try:
-> 1171             return self._engine.get_value(s, k)
   1172         except KeyError as e1:
   1173             if len(self) > 0 and self.inferred_type == 'integer':



KeyError: 0

Here is the first few columns of the data:

     imdbID     title                      rating    vote      runtime  year    genre
0   tt0111161   The Shawshank Redemption    9.3      1,439,277  142    1994 [Crime, Drama]
1   tt0468569   The Dark Knight             9.0      1,410,124  152    2008 [Action, Crime, Drama]
2   tt1375666   Inception                   8.8      1,209,159  148    2010 [Action, Mystery, Sci-Fi, Thriller]
3   tt0137523   Fight Club                  8.9      1,123,462  139    1999 [Drama]
4   tt0110912   Pulp Fiction                8.9      1,117,193  154    1994 [Crime, Drama]

movieGenre is basically collecting all the different genres from ‘genre’ column with duplicates removed: movieGenre = set(movieDF.genre.sum()) . I then added a single column to movieDF data frame for each genre such that if a particular movie belong to that genre, then that cell is True otherwise it is False. So for example, for the movie Inception, the Action column is marked True but Crime column is marked False and so forth.

Thanks.

I am trying to design some code that accepts entry of movie titles and durations, adds them to an object which then is sorted and prints the three longest movies, it runs until the last line and then fails, how should I be doing it differently?

class Movie:
    def __init__(self, title, duration):
        self.title = title
        self.duration = duration


def get_movie_duration(movie):
    return movie.duration


class MovieCollection:
    def __init__(self):
        self.movies = []

    def add_movie(self, movie):
        self.movies.append(movie)
    
    def print_longest_movies(self):
        sorted(Movie, key=get_movie_duration, reverse = True)
        print('1. '+ str(Movie.title[0]) + str(Movie.duration[0]))
        print('2. '+ str(Movie.title[1]) + str(Movie.duration[1]))
        print('3. '+ str(Movie.title[2]) + str(Movie.duration[2]))

collection = MovieCollection()
while True:
    title = input('Movie title (or blank to finish): ')
    if title == '':
        break
    duration = int(input('Movie duration (minutes): '))
    Movie.title = title
    Movie.duration = duration
    collection.add_movie(Movie)


print('n= Longest movies in the collection =')
collection.print_longest_movies()

Tim Roberts's user avatar

Tim Roberts

45.2k3 gold badges21 silver badges30 bronze badges

asked May 19, 2022 at 3:36

Owayn Redvik's user avatar

1

Your print_longest_movies function is confusing the difference between a list of objects, and their type. Movie is not a list of things. It’s just the name of the class. Plus, sorted RETURNS the sorted array. It doesn’t CHANGE the array. You want:

    def print_longest_movies(self):
        self.movies.sort(key=get_movie_duration, reverse = True)
        print('1.', self.movies[0].title, self.movies[0].duration)
        print('2.', self.movies[1].title, self.movies[1].duration)
        print('3.', self.movies[2].title, self.movies[2].duration)

You have the same confusion when creating the list. You want to create an instance of the class, not use the class name:

while True:
    title = input('Movie title (or blank to finish): ')
    if title == '':
        break
    duration = int(input('Movie duration (minutes): '))
    collection.add_movie(Movie(title, duration))

answered May 19, 2022 at 3:42

Tim Roberts's user avatar

Tim RobertsTim Roberts

45.2k3 gold badges21 silver badges30 bronze badges

Понравилась статья? Поделить с друзьями:
  • The long drive ошибка юнити
  • The long drive mod loader ошибка 0x0b46
  • The long dark ошибки новичков
  • The long dark ошибка при запуске
  • The long dark ошибка unity