Personal Video Database

English => Development => Scripts and Templates => Topic started by: sinus on January 11, 2011, 09:30:11 pm

Title: Filmweb.pl
Post by: sinus on January 11, 2011, 09:30:11 pm
Hi,
This is my first post on this forum. :)
I would like to introduce my script to read movie info from polish service http://www.filmweb.pl (http://www.filmweb.pl)
You can download it from http://www.tinyurl.pl?3b1vk3Fz (http://www.tinyurl.pl?3b1vk3Fz) (newest version is attached to this post)
Thank you from every feedback. It is first release therefore it will be refactored soon, but it's working fine for me.

best regards,
sinus

[attachment deleted by admin]
Title: Re: Filmweb.pl
Post by: Ivek23 on January 11, 2011, 10:29:36 pm
Welcome, sinus

Very nice work, for me works fine otherwise, but drawbacks such as the movie  Czworo z Teksasu (4 For Texas) (http://www.filmweb.pl/film/Czworo+z+Teksasu-1963-31799) no players, music (in your language;pozostałe informacje).Even at rest the same.I wonder why they can not see.
Title: Re: Filmweb.pl
Post by: sinus on January 12, 2011, 12:06:45 am
Thanks, I uploaded second version which read also: aka, persons, composers, directors & writers.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 12, 2011, 07:08:10 am
Thanks, I uploaded second version which read also: aka, persons, composers, directors & writers.

Thank you, right here to upload the script, they can do the upload in your post under Additional Options > Attach:
Title: Re: Filmweb.pl
Post by: Ivek23 on January 12, 2011, 07:17:33 am
The duration of the film shows is not correct.

For example:

in your case       00:02:04

proper      02:04:00

[attachment deleted by admin]
Title: Re: Filmweb.pl
Post by: sinus on January 12, 2011, 09:05:19 am
Corrected and file attached to the first post :)
Title: Re: Filmweb.pl
Post by: Ivek23 on January 12, 2011, 10:02:40 am
Corrected and file attached to the first post :)

Thanks

The duration of the film shows is not correct.

For example:

in your case       00:02:04

proper      02:04:00

Now it 's okay.

Can you tell me, how to add such rating

Code: [Select]
//orating
i := Pos('<span class="average">', HTML);
if i>0 then
begin
i := PosFrom('>', HTML, i);
j := PosFrom('<', HTML, i);
lStr := Copy(HTML, i+1, j-i-1);
AddFieldValueXML('orating', lStr);
Log(lStr);
AddFieldValueXML('orname', 'Filmweb.pl');
end;


or other added to the custom field.
Title: Re: Filmweb.pl
Post by: sinus on January 12, 2011, 11:24:02 am
If I understand correctly your intention, for example: you use another script for get movies info and from my you want only get rating? I upload new version near midnight.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 12, 2011, 02:05:37 pm
If I understand correctly your intention, for example: you use another script for get movies info and from my you want only get rating? I upload new version near midnight.

Sorry if we did not properly understand,script is fine, my only interest this code

Code: [Select]
//orating
i := Pos('<span class="average">', HTML);
if i>0 then
begin
i := PosFrom('>', HTML, i);
j := PosFrom('<', HTML, i);
lStr := Copy(HTML, i+1, j-i-1);
AddFieldValueXML('orating', lStr);
Log(lStr);
AddFieldValueXML('orname', 'Filmweb.pl');
end;



how the rating or anything else added to the custom field.
If you will upload the new script should be added separately (that other users can still download this script, which is the first post) and somehow marked or written in a post that will be known to have added a custom field.

Thank you for your understanding.

BTW:  About something like it in  AllMovie+ script  (http://www.videodb.info/forum_en/index.php?topic=1232.0).
Title: Re: Filmweb.pl
Post by: sinus on January 12, 2011, 10:58:16 pm
I uploaded new version. Rating is also added as custom field but maybe its useless if someone will use my script as the main script to gather movies info.

Code: [Select]
//orating
i := Pos('<span class="average">', HTML);
if i>0 then
begin
i := PosFrom('>', HTML, i);
j := PosFrom('<', HTML, i);
lStr := Copy(HTML, i+1, j-i-1);
lStr := StringReplace(lStr, ',', '.', true, true, false);
Log('Rating: '+lStr);
AddFieldValueXML('orating', lStr);
AddFieldValueXML('orname', 'Filmweb.pl');
AddCustomFieldValueByName(cCF_Rating, lStr);
end;

As you see, to custom fields you must use AddCustomFieldValueByName(fieldName, value) where fieldName is matched to field name in "Tools -> Preferences -> Movies -> Custom fields".
Title: Re: Filmweb.pl
Post by: Ivek23 on January 13, 2011, 07:57:27 am
Thank you for this new script.

Quote
Code: [Select]
//orating
i := Pos('<span class="average">', HTML);
if i>0 then
begin
i := PosFrom('>', HTML, i);
j := PosFrom('<', HTML, i);
lStr := Copy(HTML, i+1, j-i-1);
lStr := StringReplace(lStr, ',', '.', true, true, false);
Log('Rating: '+lStr);
AddFieldValueXML('orating', lStr);
AddFieldValueXML('orname', 'Filmweb.pl');
AddCustomFieldValueByName(cCF_Rating, lStr);
end;

As you see, to custom fields you must use AddCustomFieldValueByName(fieldName, value) where fieldName is matched to field name in "Tools -> Preferences -> Movies -> Custom fields".

I know for this AddCustomFieldValueByName but I did not know how to do this (cCF_Rating, lStr).

I removed this filmweb -no custom fields script and this quote and text is no longer valid quote and text.

[
Quote
Rating is also added as custom field but maybe its useless if someone will use my script as the main script to gather movies info.

If you allow I upload (I have already filmweb -no custom fields) the previous version of the script(luckily I saved it) without the custom fields for those users which might be using your script
Quote
as the main script to gather movies info

under this post, but if you do not allow to publish, I will remove it.You can add it to your upload.
Thanks for the reply
.]                                                                                                                                                
Title: Re: Filmweb.pl
Post by: Ivek23 on January 13, 2011, 11:30:50 am
Explanation for removal of the previous post:

This script also works the same as the previous script, so I removed the previous script.
This script works, however, also for all those that it can be used
Quote
maybe its useless if someone will use my script as the main script to gather movies info.

Quote
As you see, to custom fields you must use AddCustomFieldValueByName(fieldName, value) where fieldName is matched to field name in "Tools -> Preferences -> Movies -> Custom fields".
Rating does not work only it is spelled correctly custom field(like here
Code: [Select]
//CUSTOM FIELDS
cCF_Votes = 'Filmweb.pl votes'; //type: number
cCF_Rating = 'Filmweb.pl rating'; //type: rating
) for Rating custom field (tested, works for me).
Title: Re: Filmweb.pl
Post by: sinus on January 13, 2011, 09:01:57 pm
Aaaaaaaaaaaaa :) now i understand. Next time try to paste error message from log (http://www.videodb.info/forum_en/index.php?topic=777.msg1977#msg1977).
Title: Re: Filmweb.pl
Post by: Ivek23 on January 14, 2011, 12:22:55 pm
I must admit that is a great movie data base (basic to know). In my case I have in PVD database currently includes around 560 movies from this we can not find any information for about 60 movies, a very commendable but also that we find a screenshot of about 300 movies.

I am interested in the screenshot is something about the size of thumbnails (the size is now 90x90). For PVD database, this is better because it take up less space.
The possibility of such thumbnail-size 150x150 or the current size of the frame such that it can not be changed. I ask this in relation to my impaired vision, the easier this screenshot thumbnails to see clearly.
Thanks for the clarification.
Title: Re: Filmweb.pl
Post by: sinus on January 14, 2011, 10:09:35 pm
I must admit that is a great movie data base (basic to know). In my case I have in PVD database currently includes around 560 movies from this we can not find any information for about 60 movies, a very commendable but also that we find a screenshot of about 300 movies.

In fact, with PVD and my script it can be useful also for non-polish users. :D

I am interested in the screenshot is something about the size of thumbnails (the size is now 90x90). For PVD database, this is better because it take up less space.
The possibility of such thumbnail-size 150x150 or the current size of the frame such that it can not be changed. I ask this in relation to my impaired vision, the easier this screenshot thumbnails to see clearly.
Thanks for the clarification.

Check new version. I added option (default enabled) to get large (in original size) screenshots. And, of course, I get for now only a few screenshots which are available on main movie page.

Full size screenshot you can see after double-click on thumbnail.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 15, 2011, 08:24:53 am
I must admit that is a great movie data base (basic to know). In my case I have in PVD database currently includes around 560 movies from this we can not find any information for about 60 movies, a very commendable but also that we find a screenshot of about 300 movies.

In fact, with PVD and my script it can be useful also for non-polish users. :D

I am interested in the screenshot is something about the size of thumbnails (the size is now 90x90). For PVD database, this is better because it take up less space.
The possibility of such thumbnail-size 150x150 or the current size of the frame such that it can not be changed. I ask this in relation to my impaired vision, the easier this screenshot thumbnails to see clearly.
Thanks for the clarification.

Check new version. I added option (default enabled) to get large (in original size) screenshots. And, of course, I get for now only a few screenshots which are available on main movie page.

Full size screenshot you can see after double-click on thumbnail.

Thank you very much for larger screenshots.
This screenshot thumbnail size is acceptable for me.

[attachment deleted by admin]
Title: Re: Filmweb.pl
Post by: Ivek23 on January 15, 2011, 07:36:44 pm
With the previous version filmweb 0.0.0.5 I transferred the screenshot but the filmweb 0.0.0.6 I would like to replace certain screenshot thumbnails for larger and are not replaced, except when they physically removes himself before me by the new order.
Is that what you do to be automatically switched to the new screenshot thumbnails.
But it is also a problem in their own screenshot images, because even if script does not transfer screenshot images from filmweb.pl page.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 17, 2011, 08:46:53 pm
In version 0.0.0.5 and 0.0.0.6 does not work (download) more data for rating, votes, and poster images somehow from 18.00 hours today (at least at my place this above does not work anymore).
Since I use both versions would of course be glad of the correction of both versions.
Thank you for such a request.
Title: Re: Filmweb.pl
Post by: sinus on January 17, 2011, 10:31:13 pm
With the previous version filmweb 0.0.0.5 I transferred the screenshot but the filmweb 0.0.0.6 I would like to replace certain screenshot thumbnails for larger and are not replaced, except when they physically removes himself before me by the new order.
Is that what you do to be automatically switched to the new screenshot thumbnails.
But it is also a problem in their own screenshot images, because even if script does not transfer screenshot images from filmweb.pl page.

I don't see any function for scripts to clear screenshots or override screenshot with new one. Even, I don't see any option in program.

In version 0.0.0.5 and 0.0.0.6 does not work (download) more data for rating, votes, and poster images somehow from 18.00 hours today (at least at my place this above does not work anymore).
Since I use both versions would of course be glad of the correction of both versions.
Thank you for such a request.

Thank you for information. There are small changes in page. Uploaded 0.0.0.7 with fixes and importing "release" field (but months names are in polish).

Why you use 0.0.0.5?
Title: Re: Filmweb.pl
Post by: Ivek23 on January 18, 2011, 06:44:52 pm
Quote
Why you use 0.0.0.5?

From the simple reason that in version 0.0.0.6, the rating did not show the custom field but only votes in version 0.0.0.5 and both rating and the votes were in the custom field.

In the screenshot thumbnails is because version 0.0.0.5 for all those movies where I found the screenshot thumbnails rather than important, it may have been small (90x90) and 5 or 6 screenshot images quite enough for all the other movies that made me it seemed important (like all movies about James Bond or John Wayne movies and many Western movies - by the way I am a big fan of good classic Western movies), I am due to larger (often there were a large number of screenshot thumbnails - maximum 10 screenshot thumbnail) screenshot thumbnails using version 0.0.0.6.

For version 0.0.0.7, I can not say anything because I do this script does not display anything - does not work.

I did some tests:

1.) If you do not copy the URL into the URL box script does not work.

2.) If you copy the URL in the URL field and script (from version 0.0.0.5 to version 0.0.0.7) works, but not all.

It does not work:

Rating in the custom field.

Description in PVD description box works, but the custom field (say, by Filmweb.pl) did not   - sorry for description, my mistake in the appointment of a custom field.
Title: Re: Filmweb.pl
Post by: sinus on January 18, 2011, 09:44:32 pm
Uploaded 0.0.0.8 :-]
If you don't want to get large screenshots then find in script line with "cOption_GetLargeScreenshots = true;" and change it to "cOption_GetLargeScreenshots = false;"
Title: Re: Filmweb.pl
Post by: Ivek23 on January 18, 2011, 11:54:13 pm
Uploaded 0.0.0.8 :-]
If you don't want to get large screenshots then find in script line with "cOption_GetLargeScreenshots = true;" and change it to "cOption_GetLargeScreenshots = false;"

Quote
It does not work:

Rating in the custom field.

I still do not work rating in custom field.

This option
Code: [Select]
cOption_AddCustomFieldRating = false;
should be replaced for this
Code: [Select]
cOption_AddCustomFieldRating = true;
However, now work rating in the custom field.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 19, 2011, 07:55:06 am
Code: [Select]
Changelog:
2011-01-18 v.0.0.0.8
Fix: results
2011-01-17 v.0.0.0.7
New: release field
Fix: rating, votes, poster
2011-01-14 v.0.0.0.6
New: option to gather large screenshots (default enabled)
New: option to adding custom field cCF_Rating (default disabled)
New: option to don't add additional rating ("orating", default disabled)
2011-01-12 v.0.0.0.5
New: custom fields (votes, rating)
Fix: rating fix (','->'.')

Sorry for my english 8-)
 *)
 
const
//script nfo
SCRIPT_VERSION = '0.0.0.7';
SCRIPT_NAME = 'Filmweb.pl';
SCRIPT_DESC = '[PL] Informacje o filmie z Filmweb.pl';
SCRIPT_TYPE = 0;

2011-01-18 v.0.0.0.8

Wrong

SCRIPT_VERSION = '0.0.0.7';

Otherwise it is OK for now.

Uploaded 0.0.0.8 :-]
If you don't want to get large screenshots then find in script line with "cOption_GetLargeScreenshots = true;" and change it to "cOption_GetLargeScreenshots = false;"

Now I can also be used in addition to modify the original copy of the latest version of my needs.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 19, 2011, 05:42:36 pm
In version 0.0.0.8 does not work (download) more data for rating and votes somehow from 16.00 hours today (at least at my place this above does not work anymore).

I apologize if it may be too bothering or too ask, but what is happening in filmweb.pl web site so that frequent changes in recent times.
If you may know how long something will occur to those changes, so I might be a good proposal that might wait until the point when the changes will be completed and then update the script, Indeed when I was in the middle of updating PVD database for certain pieces of information they do not want more update (I find that time - which often do - via the url address in the PVD database visit web site and checking the information on it).

Thanks in advance for any information about the changes or just the end (at least for some time and would script worked without problems) on the website.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 22, 2011, 04:34:26 pm
In version 0.0.0.8 does not work (download) more data for rating and votes somehow from 16.00 hours today (at least at my place this above does not work anymore).

Also, 'description' does not work.
Title: Re: Filmweb.pl
Post by: Ivek23 on January 23, 2011, 01:25:03 pm
In version 0.0.0.8 does not work (download) more data for rating and votes somehow from 16.00 hours today (at least at my place this above does not work anymore).

I apologize if it may be too bothering or too ask, but what is happening in filmweb.pl web site so that frequent changes in recent times.
If you may know how long something will occur to those changes, so I might be a good proposal that might wait until the point when the changes will be completed and then update the script, Indeed when I was in the middle of updating PVD database for certain pieces of information they do not want more update (I find that time - which often do - via the url address in the PVD database visit web site and checking the information on it).

Thanks in advance for any information about the changes or just the end (at least for some time and would script worked without problems) on the website.

Sinus, which is now a guest, apologize to him if it was the wrong word.

Is it possible someone which they happen to understand the script and it does what it can to operate this script from http://www.filmweb.pl/base for example ( Zakochana złośnica (10 Things I Hate About You)  (http://www.filmweb.pl/film/Zakochana+z%C5%82o%C5%9Bnica-1999-721))  web pages.
It is interesting because of the screenshot thumbnails (at least for me it is so).
I have already pretty screenshot thumbnails for a lot of movies, but would of course be happy, more movies, which could add screenshot thumbnails in my collection of movies.

Thanks

BTW: Here is my e-mail address in the first post.
http://www.videodb.info/forum_en/index.php/topic,2249.0.html