plugin.video.lostfilm.tv icon indicating copy to clipboard operation
plugin.video.lostfilm.tv copied to clipboard

Lostfilm.tv changed, plugin starts to produce only the errors

Open Jabberwacky opened this issue 8 years ago • 47 comments

Starting from today 30.1.2017 plugin on my Raspberry 3 stoped to work at all. As I can see, Lostfilm had changed their site. So, is it a time to change something in a plugin? This is the error codes:

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.ValueError'> Error Contents: need more than 0 values to unpack Traceback (most recent call last): File "/home/osmc/.kodi/addons/plugin.video.lostfilm.tv/addon.py", line 12, in run_plugin() File "/home/osmc/.kodi/addons/plugin.video.lostfilm.tv/resources/lib/support/common.py", line 348, in run_plugin plugin.run() File "/home/osmc/.kodi/addons/plugin.video.lostfilm.tv/resources/lib/xbmcswift2/plugin.py", line 342, in run items = self._dispatch(self.request.path) File "/home/osmc/.kodi/addons/plugin.video.lostfilm.tv/resources/lib/xbmcswift2/plugin.py", line 303, in _dispatch listitems = view_func(**items) File "/home/osmc/.kodi/addons/plugin.video.lostfilm.tv/resources/lib/lostfilm/routes.py", line 116, in index episodes = scraper.browse_episodes(skip) File "/home/osmc/.kodi/addons/plugin.video.lostfilm.tv/resources/lib/lostfilm/scraper.py", line 282, in browse_episodes episode_titles, original_titles = zip(*[parse_title(t) for t in titles]) ValueError: need more than 0 values to unpack -->End of Python script error report<-- 20:42:41 124.985718 T:1956828080 ERROR: GetDirectory - Error getting plugin://plugin.video.lostfilm.tv/ 20:42:41 124.987030 T:1956828080 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.lostfilm.tv/) failed

Jabberwacky avatar Jan 30 '17 17:01 Jabberwacky

I have investigated the new lostfilm site yesterday, and while it is possible to tweak the plugin to be used with new authentication and series list, I saw no way to get the actual download link for an episode.

The page (popup) with download links is opened with javascript "onclick" event (haven't found the definition of the function). The url of this popup have 6 params:

  • series id (pretty easy to get it)
  • season number (no problems here)
  • episode number (also no problems)
  • user id (available on the profile page, just have to get it and cache)
  • some kind of MD5 hash (a mystery)
  • last parameter is always 1 (at least for me it is)

So basically, if one will figure out what this mysterious MD5 hash is, then current plugin can be updated.

Update: Just found the way to get download links. So for now I see nothing that could stop this plugin from being updated. Maybe will try to do it myself, though, I'm not a python specialist.

Ksantor avatar Jan 31 '17 09:01 Ksantor

Ksantor, I made those changes, which are fixing underscores, but logs still have showed above errors. There is something wrong with browse_episodes subprogram. As I was able to understand, it can't load nothing from site.

Jabberwacky avatar Jan 31 '17 09:01 Jabberwacky

Underscores were fixed by myself in a stupid easy manner, previously, I just changed faulty episodes IDs to the 191 ID in the scraper.py file. Just added two strings of python code. That was the top of my knowledges of this language. After approximately two weeks there was four-five IDs in a "database":) Tommixoft had saw the root of problem. And fixed it totally. But now IMHO it is a global trouble.

Jabberwacky avatar Jan 31 '17 09:01 Jabberwacky

@Jabberwacky this is due to the complete redesign of the LostFilm.tv site. Unfortunately the underscore fix is useless now, and much more work has to be done to get the plugin working again:

  • update the authentication flow
  • update the series and episodes list parser
  • update the series library parser

Ksantor avatar Jan 31 '17 09:01 Ksantor

Yes... I Lost my Films...

Jabberwacky avatar Jan 31 '17 09:01 Jabberwacky

I'm not sure, if @anteo is interested in maintaining/updating this plugin further, but I'll try to fix it myself, though, can't promise a fast result.

Ksantor avatar Jan 31 '17 09:01 Ksantor

That would be perfect :)))! Unfortunately, I know a little about web programming. Better to say know nothing. So I can't help.

P.S. January 2017 anteo has no activity yet for this period. May - December 2016 anteo had no activity during this period.

Sure, noble Anteo started to work on more interesting projects... So, dear Ksantor, you are - the only ours hope :)

Jabberwacky avatar Jan 31 '17 10:01 Jabberwacky

Lostfilm.tv changed their website so this plugin is doomed or have to be all regex and url rewritten in addon.

With Kodi addons is hard to develop cause you cant debug it.

Tommixoft avatar Jan 31 '17 13:01 Tommixoft

It's a bunch of work to rebuild all in an addon... Nobody knows this plugin as its creator. I guess, if Anteo will not take part in this work, no one will load it on his shoulders. LostFilm RIP

Jabberwacky avatar Jan 31 '17 13:01 Jabberwacky

Guys, I'll do my best, because I used this plugin heavily myself and don't want to let it go just like that.

@Tommixoft eveything is not so bad as it looks.

Ksantor avatar Jan 31 '17 13:01 Ksantor

@Ksantor - im .NET, php programmer i dont write python, but anyways when i look at source - he almost never use TRY, he never check is list empty or null. he just uses variables not even thinking that it may be empty or some error may happen. That's why underscore broke plugin. Its minor problem but broke whole plugin :) I know now underscore is least of problem, but first undersscore broke plugin, well datetime format broke it, then underscore and now web page redesign :D

Tommixoft avatar Jan 31 '17 14:01 Tommixoft

It is my style of work ;) This addon is splitted aparts pretty well. The only way to debug everything - is to see the logs. Annoying. I am a, commonly, VB.NET 'programmer' VisualStudio - is the only programming environment for me.

Jabberwacky avatar Jan 31 '17 16:01 Jabberwacky

Just to keep everybody informed:

Made a fork. Nothing important to see there yet, but will keep working on it!

Ksantor avatar Feb 01 '17 18:02 Ksantor

почему все общаются на английском про сайт, который переводит фильмы на Русский?

Kirrrilka avatar Feb 02 '17 18:02 Kirrrilka

Because for example i do understand russian good but i cant write in russian :)

Tommixoft avatar Feb 02 '17 19:02 Tommixoft

:)))) вай нот? Кому-то может оказаться интересной информация по этому аддону, но он может не знать русского. А может смотрит знакомые сериалы на русском, чтобы его изучить? Я просто забыл о сути самого аддона и был огорчен его сбоем и думал как его починить. Все что у меня получалось ранее с этим аддоном - вырезать часть таймстемпа, чтобы не было глюков с изменившимся таймстемпом файлов и заменять сбойнутые имена на гарантированно нормальное, когда возникла ошибка с подчеркиванием. Оказалось, что предстоит работка на порядки более сложная. О том, что показывал аддон, я совсем забыл.

Jabberwacky avatar Feb 02 '17 19:02 Jabberwacky

Looks like I made some real progress!

Will test it myself in "real life". In case of success will post *.zip links and a README in my repo.

Ksantor avatar Feb 03 '17 21:02 Ksantor

Uploaded a first version in my repo. You can check it out and open new issues, if you'll find any bugs or encounter any problems.

Ksantor avatar Feb 05 '17 10:02 Ksantor

@Ksantor sad but doesnt work. and your repo doesnt have ISSUES tab. installed on 2 systems when i go to plugin it shows 0 items. no menu, nothing... like im in empty folder.

Tommixoft avatar Feb 05 '17 16:02 Tommixoft

8:41:26 T:9948  NOTICE: [plugin.video.lostfilm.tv] Starting LostFilm.TV library update...
18:41:26 T:9948  NOTICE: [support.library] Starting library sync...
18:41:26 T:9948  NOTICE: [support.library] Library sync finished (0 file(s) created, 0 added, 0 updated, 0 removed)
18:41:26 T:9948  NOTICE: [plugin.video.lostfilm.tv] LostFilm.TV library update finished.
18:41:26 T:9948  NOTICE: [plugin.video.lostfilm.tv] Scheduling next library update at 2017-02-06 06:41:26.325000
18:42:05 T:6724  NOTICE: [xbmcswift2] Request for "/" matches rule for function "index"
18:42:05 T:6724  NOTICE: [lostfilm.network_request] Authorization started...
18:42:05 T:6724  NOTICE: [lostfilm.network_request] Fetching URL https://www.lostfilm.tv/ajaxik.php with params None started...
18:42:05 T:6724   ERROR: C:\Users\Tomas\AppData\Roaming\Kodi\addons\script.module.requests\lib\requests\packages\urllib3\util\ssl_.py:334: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
                                              SNIMissingWarning
18:42:05 T:6724   ERROR: C:\Users\Tomas\AppData\Roaming\Kodi\addons\script.module.requests\lib\requests\packages\urllib3\util\ssl_.py:132: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
                                              InsecurePlatformWarning
18:42:07 T:6724  NOTICE: [lostfilm.network_request] Fetching URL https://www.lostfilm.tv/ajaxik.php with params None taken: 1.938154 seconds
18:42:07 T:6724  NOTICE: [lostfilm.network_request] Authorization taken: 1.938439 seconds
18:42:07 T:6724  NOTICE: [lostfilm.network_request] Fetching URL https://www.lostfilm.tv/my/type_1 with params None started...
18:42:07 T:6724  NOTICE: [lostfilm.network_request] Fetching URL https://www.lostfilm.tv/my/type_1 with params None taken: 0.065396 seconds

Tommixoft avatar Feb 05 '17 16:02 Tommixoft

@Tommixoft, looks like some SSL error. Previous implementation used http for authentication. I've changed the urls to https (by the way, be careful, lostfilm.tv web page doesn't switch to https by default).

If you don't mind sending your credentials for lostfilm.tv account over http, you can try to fix it youself: in \AppData\Roaming\Kodi\addons\plugin.video.lostfilm.tv\resources\lib\lostfilm\network_request.py change

20: BASE_URL = "https://www.lostfilm.tv"
21: POST_URL = "https://www.lostfilm.tv/ajaxik.php"

to:

20: BASE_URL = "http://www.lostfilm.tv"
21: POST_URL = "http://www.lostfilm.tv/ajaxik.php"

Should help.

Meanwile, I'll try to understand, what is the problem with SSL.

P.S. Added "Issues" page to my repo.

Ksantor avatar Feb 05 '17 17:02 Ksantor

Thanks. Will try. Maybe you're using linux? windows is not so easy with ssl. Maybe you can somehow bypass SSL veryfication and so on.

Tommixoft avatar Feb 05 '17 18:02 Tommixoft

@Ksantor Not working anyways...log became even smaller. Plugin still shows 0 entries, no even static menu like "My Library".

20:18:47 T:5888  NOTICE: [lostfilm.network_request] Authorization started...
20:18:47 T:5888  NOTICE: [lostfilm.network_request] Fetching URL http://www.lostfilm.tv/ajaxik.php with params None started...
20:18:47 T:5888  NOTICE: [lostfilm.network_request] Fetching URL http://www.lostfilm.tv/ajaxik.php with params None taken: 0.079945 seconds
20:18:47 T:5888  NOTICE: [lostfilm.network_request] Authorization taken: 0.080223 seconds
20:18:47 T:5888  NOTICE: [lostfilm.network_request] Fetching URL http://www.lostfilm.tv/my/type_1 with params None started...
20:18:47 T:5888  NOTICE: [lostfilm.network_request] Fetching URL http://www.lostfilm.tv/my/type_1 with params None taken: 0.051973 seconds

Tommixoft avatar Feb 05 '17 18:02 Tommixoft

Hello all, for me everything is working :), thank you, one thing in old plugin and website you need to login with nickname, now it is email :), first tried with nickname and i had empty list :)

capris avatar Feb 05 '17 19:02 capris

@capris It always was email, atleast im using email year already. What OS you're running?

Tommixoft avatar Feb 05 '17 19:02 Tommixoft

newest, krypton on android tv. i was using nicname till today :) and did you marked series as favorite in the web as said in the readme ?

capris avatar Feb 05 '17 20:02 capris

Dear guys! Look, what I found on the XBMC.RU forum. It is a temporary solution. http://xbmc.ru/forum/showthread.php?t=12469&highlight=lostfilm&page=18

eczo Junior Member

Регистрация: 05.02.2017 Сообщений: 1 По умолчанию Всем привет

Нашел временное решение: В plugin.video.lostfilm.tv/resources/lib/lostfilm/scraper.py поправил переменную: BASE_URL = "http://www.lostfilm.tv" на BASE_URL = "http://old.lostfilm.tv" Плагин заработал, со старой регистрацией. Не знаю, сколько еще проживет old.lostfilm.tv, но адаптация под новый сайт, это не просто замена url на новый, парсер также нужно править. P.s. у меня работает на Ubuntu 16.04 + kodi 17 и Xiaomi Mi Box Android TV 6 + kodi 17 Последний раз редактировалось eczo; Вчера в 13:24.

Jabberwacky avatar Feb 06 '17 16:02 Jabberwacky

@Jabberwacky just found the same thing about an hour ago while was investigating the new lostfilm site. Really looks like a valid solution, though, yea, who knows for how long the old site will be active.

Ksantor avatar Feb 06 '17 16:02 Ksantor

I have started porting of the the original addon to work with the new Lostfilm interface. Please, find the project via the link: https://github.com/winnipeg8/plugin.video.lostfilm.tv. Looks like it is workable. Basically, the only changes I have done are in "resources/lib/lostfilm/" folder. The biggest issues so far are: 1) their new authentication protocol (I am still using the old one); 2) details information parsing. It would be really cool, if someone could help me with these problems. Also, don't get mad on my code changes - I am not a professional:)

omikhailovskii avatar Feb 08 '17 16:02 omikhailovskii

@winnipeg8 original plugin was written poorly. I more like @Ksantor version. Also i started to create new features to Ksantor version. Of course it's SUPER basic now. I think it will never have Library support, which anyways was broken in original plugin. This new version will be (at least so far) online, no caching of series, episodes. Full read of everything from website (favorites for example)

Tommixoft avatar Feb 08 '17 19:02 Tommixoft