Help with work on a new script (csfd.cz)

How to make Movienizer support new sites. Customize Movienizer.
demo30
Passerby
Posts: 6
Joined: Thu Jan 07, 2016 8:17 pm

Help with work on a new script (csfd.cz)

Post by demo30 » Sat Jan 09, 2016 3:49 pm

Hi,
I'm trying to write a new movienizer script for Czech movie web database csfd.cz, but I got stuck and need help. I was able to get the search results and their respective urls and now I'd like to gather all the info about the movie using the GetInfo function.

However, there's a problem with the DownloadURL function that I can't overcome. I had no trouble using it during the first stage to get the source code of the website with the search results, but I'm unable to successfully use it in the GetInfo function to get the source code of the particular movie's site. What happens is that sometimes I get correct result from the url (the source code), but more often I end up with some rubbish (see the image attached), that I can't parse.

I suspect it might have something to do with some kind of compression and I've seen another similar script using a curl.exe probably in order to overcome such problems, but I'm unable to run the .exe file from the script as there seem to be no Launch() function to run it as is the case with the other script I've seen.

To sum it up: I'd need to know how to successfully execute DownloadURL(url) every time with url being equal for example to 'http://www.csfd.cz/film/7563-spider-man/'.

Thanks,
Demo
Attachments
001.png
ShowMessage() of the result
001.png (71.71 KiB) Viewed 7460 times

User avatar
Vlad
Developer
Posts: 2941
Joined: Wed Jan 23, 2008 11:37 am

Re: Help with work on a new script (csfd.cz)

Post by Vlad » Mon Jan 11, 2016 1:20 pm

Could you send us the script for checking this issue?
ImageImage

demo30
Passerby
Posts: 6
Joined: Thu Jan 07, 2016 8:17 pm

Re: Help with work on a new script (csfd.cz)

Post by demo30 » Mon Jan 11, 2016 6:46 pm

Hey,

here you go. I left everything unchanged, so please ignore the comments and any superfluous variables/functions. You might have to run it few times to actually reproduce the undesired outcome. Also, I should have probably mentioned, that I test everything only on an unregistered version Movienizer 8.1 Build 454.

In case you'd be interested, here you can get the other script I was writing about (http://amc.thez.info/script/csfd.cz.4.ifs)

Best regards,
Demo
Attachments
CSFD_vlastni_movie.pas
(7.9 KiB) Downloaded 165 times

User avatar
Vlad
Developer
Posts: 2941
Joined: Wed Jan 23, 2008 11:37 am

Re: Help with work on a new script (csfd.cz)

Post by Vlad » Wed Jan 13, 2016 9:33 am

Please try the attached file.
ImageImage

demo30
Passerby
Posts: 6
Joined: Thu Jan 07, 2016 8:17 pm

Re: Help with work on a new script (csfd.cz)

Post by demo30 » Wed Jan 13, 2016 5:16 pm

Hi,

unfortunately that doesn't seem to make any difference. Have you been able to reproduce the issue or is it just me?

Regards,
Demo

User avatar
Vlad
Developer
Posts: 2941
Joined: Wed Jan 23, 2008 11:37 am

Re: Help with work on a new script (csfd.cz)

Post by Vlad » Thu Jan 14, 2016 6:15 pm

Yes, we saw this problem, it should be resolved by the new version. Please try deleting the corresponding .comp file and make sure that the .pas file contains the new lines (at the end).
ImageImage

User avatar
Vlad
Developer
Posts: 2941
Joined: Wed Jan 23, 2008 11:37 am

Re: Help with work on a new script (csfd.cz)

Post by Vlad » Thu Jan 14, 2016 6:19 pm

Just checked, the issue is back, so need to take a further look :)
ImageImage

User avatar
Vlad
Developer
Posts: 2941
Joined: Wed Jan 23, 2008 11:37 am

Re: Help with work on a new script (csfd.cz)

Post by Vlad » Thu Jan 14, 2016 6:23 pm

Let's try this one.
Attachments
CSFD_vlastni_movie.pas
(8.32 KiB) Downloaded 158 times
ImageImage

User avatar
Vlad
Developer
Posts: 2941
Joined: Wed Jan 23, 2008 11:37 am

Re: Help with work on a new script (csfd.cz)

Post by Vlad » Fri Jan 15, 2016 1:16 pm

In general, it looks like the server is misconfigured. It sends request headers instead of response headers, and ignores specific settings requested by a client.
ImageImage

demo30
Passerby
Posts: 6
Joined: Thu Jan 07, 2016 8:17 pm

Re: Help with work on a new script (csfd.cz)

Post by demo30 » Fri Jan 15, 2016 7:33 pm

Hey,

well, that kinda goes over my head, so I can't be of much help. What's weird is that it sometimes does work and sometimes it doesn't. Would something like "retry 10 times until you get the correct result" be too much of a nasty solution for you? :D I probably wouldn't mind this that much, but I don't know how to set up the result-checking condition myself.

What the authors of the above mentioned script say about the server might be useful: "The CSFD website started using nginx server for the request handling and it makes some of the sites be stored in the cache. Unfortunately (probably on purpose), while returning the results from the cache, it ignores any request settings for data compression. As a result, when the site is first loaded everything works fine, however on the second try a gzip compression is used regardless of the browser's request settings. Since a concurrent software doesn't support data decompression, it cannot handle the data." The solution they came up with is one that uses curl.exe file.

Good luck,
Demo

Post Reply