Author Topic: Adult.DVDEmpire.com (movies)  (Read 24542 times)

0 Members and 1 Guest are viewing this topic.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Adult.DVDEmpire.com (movies)
« on: July 02, 2008, 02:00:06 am »
Current script version [0.1.0.0]

[attachment deleted by admin]
Gentlemen, you can’t fight in here! This is the War Room!

Offline efrasiyab

  • Member
  • *
  • Posts: 27
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #1 on: July 03, 2008, 07:04:04 am »
Thanks :)

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #2 on: January 15, 2009, 02:43:10 pm »
Hi,

I've noticed lately that this script no longer properly imports the Production Year for titles from the website. It appears that Adult DVD Empire modified the text preceding the year value on their website, which the parser in the script depends on to locate the year. Fortunately, the script is easy enough to fix. Just locate the "adultdvdempire.psf" file (in the Scripts subfolder of the main Personal Video Database program folder), open it with a text editor, and search for all occurances of the string "Production Year" and replace them with just "Year".

For reference, the affected sections of code are as follows:
(Starting around line 204)
--------------------------------------------------------
//Year
 AddFieldValue(mfYear, Trim(TextBetween(HTML, '/ Production Year:', '</span>', False, curPos)));  <--- change this
 if curPos < 1 then
  curPos := EndPos; 
--------------------------------------------------------
and (within procedure ParseSearchResults, around line 347)
--------------------------------------------------------
 
  curPos := PosFrom(' Production Year: ', HTML, EndPos);    <---change this
  if curPos > 0 then begin 
   curPos := curPos + Length(' Production Year: ');             <---change this
   EndPos := PosFrom('</span>', HTML, curPos);
 
   Year := Trim(Copy(HTML, curPos, EndPos - curPos));
  end;
--------------------------------------------------------

Hope this helps.
Aimhere

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #3 on: January 15, 2009, 11:06:50 pm »
 
Quote
Hope this helps.

It does, especially as an illustration of how easy it is to modify and maintain script.

Users should feel free to post modified/updated scripts—that's why the scripting feature was added. My suggestion as to how to do this is to add something like this...

//Script data
//Fixed: "Production Year" changed to "Year" - AimHere 01/15/2009
SCRIPT_VERSION = '0.1.0.1';

...to document the change (in addition to appropriate comments in the body of the script). The script could be named "adultdvdempire 0.1.0.1.psf" and attached to a post that more fully explains the changes. If the changes were more significant and constituted a new "branch" (i.e., users would have a choice of using the new version, or sticking with the old), the version number would be "0.1.1.0".

No one should be concerned about scripts they post being bug-free or appropriate for all other users. Others can correct or modify the script and post their own version. It would be appropriate, for example, to post a script will a message that says something like, "This is my latest attempt to make this work. I'm still having trouble with..."

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Adult.DVDEmpire.com (movies)
« Reply #4 on: January 15, 2009, 11:35:37 pm »
Golden words, rick.

Quote
//Script data
//Fixed: "Production Year" changed to "Year" - AimHere 01/15/2009
SCRIPT_VERSION = '0.1.0.1';

This is especially a good advice.
Gentlemen, you can’t fight in here! This is the War Room!

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #5 on: January 26, 2009, 01:39:49 am »
Another update:

I noticed that the existing script did not import anything into a movie's "Category" field, despite AdultDVDEmpire providing "Category" information for each movie title. So, I went ahead and added that functionality to it. I basically found the subroutine that imports the "Genre" field and copied it, substituting "Category" for "Genre":
Code: [Select]
//Category
 curPos := PosFrom('<div class="Item_BrowseSectionTitle">Category:&nbsp;&nbsp;</div>', HTML, curPos);
 if curPos > 0 then begin
  curPos := curPos + Length('<div class="Item_BrowseSectionTitle">Category:&nbsp;&nbsp;</div>');
  EndPos := PosFrom('</div>', HTML, curPos);
  Tmp := Trim(RemoveTags(Copy(HTML, curPos, EndPos - curPos), False));
 
  AddFieldValue(mfCategory, Tmp);
 end;
 

Note that this part should be inserted right before the "//Genre" section.

Following the advice of previous posts, I also updated the "//Script Data" section and bumped up the version number:
Code: [Select]
//Script data
 //Fixed: "Production Year" changed to "Year" - AimHere 01/15/2009
 //Added: movie Category field - AimHere 01/25/2009
 SCRIPT_VERSION = '0.1.0.2';

I've tested this against my own database and it works as intended. Note that with AdultDVDEmpire, it is possible for a title to belong to more than one category.

I'm attaching the complete script to this post.

Enjoy!

[attachment deleted by admin]
« Last Edit: January 26, 2009, 01:41:29 am by AimHere »

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #6 on: January 26, 2009, 04:02:38 am »
Hi again,

While importing some movie info, I happened to discover a bug with the plugin. If there is no single exact match for a movie on ADE (e.g. multiple matches, or no exact match at all), the plugin pops up a dialog listing possible matches for the user to choose from. But sometimes, that list will be missing some titles, and some of the ones that are shown will have the wrong year displayed alongside them. This can be verified by opening a web browser, going to the ADE site, and plugging the title of the movie (as you entered it in PVD) into the search form.

It appears the problem is that the ADE search results don't always give a "Production Year" for every movie on the list; sometimes, there is only a release date. But the plugin depends on the Production Year when generating the list for the dialog, and if it is missing, the plugin takes the year from the next entry that does have a "Production Year" tag. And in the process, skips over everything in-between!

For example, suppose a search  would turn up the following results if done manually:

  • Movie A,  Release Date 1/1/2002 ~ Production Year 2001
  • Movie B   Release Date 9/9/2007    (missing Production Year)
  • Movie C,  Release Date 10/10/2000 ~ Production Year 1999
  • Movie D,  Release Date 12/25/1986 ~ Production Year 1985

The plugin would pop up a dialog containing this, instead:

  • Movie A (2001)
  • Movie B (1999)
  • Movie D (1985)

Note that Movie B has picked up the "Year" from Movie C, and Movie C itself is skipped entirely.  If there happen to be several entries between the one that is missing the "Production Year" and the next one that isn't, ALL the ones in-between will be skipped. I've seen search results that might contain a dozen entries, yet the ADE plugin only showed three! :(

Perhaps it would be better to extract the "Release Date" information from the search results, and use that to populate the list in the dialog?  Every entry in the search results does have a "Release Date" given, unlike the "Production Year", so no special programming tricks would be needed to avoid skipping entries.

Better still, I think, would be to extract the name of the production studio from the search results, and display THAT in the dialog, instead of (or in addition to) the year of production or release. Personally, I think it would be easier to distinguish among similarly-titled movies based on the name of the studio, rather than the year, since there ARE sometimes several movies with the same title released in the same year by different studios. (I guess in the porn industry it's hard to be original, LOL!)

(Note that the problem only affects the generation of the list that's shown for the user to choose from. I believe that once the user picks an item from the list and clicks "OK", the script will properly extract the "Production Year" [if it exists] from the main webpage for the chosen movie, in a separate step. However, even this could stand to be improved, since if the "Production Year" is not given for a movie at all, the script currently fills the "Year" field in PVD with a value of 0 [zero]...)

I'll see if I can figure out a way to fix these problems. My previous modifications were pretty simple, and I'm not really familiar enough with the PVD scripting system to make bigger changes just yet, but I'll see what I can do.

Aimhere

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #7 on: March 06, 2009, 10:52:02 pm »
Adult.DVDEmpire.com script version 0.1.0.3

Hi again,

Okay, I made a few more changes. First, per my previous post, the search results parsing was modified to include the Studio name in the results, and to do a sanity check on the presence of the production year. Search results are now presented in either of the following forms:

Quote
Title / Studio (Year)
OR
Title / Studio

Note that the production Year is only included if the Adult DVD Empire search results page includes it for that item. The script no longer "skips over" items in the search results if the Production Year is missing. This should avoid a lot of confusion.

Unfortunately, I also discovered that Adult DVD Empire recently changed the formatting of the URLs in search results, which completely broke the PVD script! That is, attempting to import movie information with the AdultDVDEmpire script did NOTHING. The script couldn't locate the keywords it was expecting to see in the HTML, and so couldn't extract ANY information from the webpages.

So I scrutinized the HTML generated by the Adult DVD Empire search engine, and made some adjustments. The script will once again properly import the original title, year, genres, categories, studio, URL, description, and features.

However, the script might not properly import people names (actors, director, etc.).  The HTML around the Cast list has changed (especially URLs). I wrangled with the script enough for it to extract at least some of the people names and associated URLs, but some things still aren't working right. On several tests I ran, the modified script imported all people properly; on others, it only grabbed a few, and/or missed their URLs.  It's not perfect, but right now I'm tired of beating my head against this particular wall. I think it's going to take someone with greater programming skill than I to fully correct the page parsing.  (Nostra, are you listening???)

Aimhere

[attachment deleted by admin]

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #8 on: March 30, 2009, 03:21:00 pm »
Okay, another minor update of the script...

Seems Adult DVD Empire changed some of their HTML (again) and the script wasn't importing the studio name at all. Fixed.

AimHere

[attachment deleted by admin]

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #9 on: April 12, 2009, 12:25:09 am »
A revised script for versions 0.9.9.5+ only has been posted here.

Hopefully, Aimhere will be willing to maintain both versions of the script. :-\

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #10 on: April 23, 2009, 10:33:04 pm »
A revised script for versions 0.9.9.5+ only has been posted here.

Hopefully, Aimhere will be willing to maintain both versions of the script. :-\

Oh, do I have to???  :P Sigh...

Anyway, yet another update: Adult DVD Empire changed the URLs linking to studio pages, both in the search results page and on the individual DVD info pages. This broke the extraction of the studio names. I think I have it fixed, but it may not be bulletproof. (Basically, there's no longer a fixed string as part of the studio page URL; I had to make the script search for a different fixed string preceding the URL, then assume that the name of the studio is right after the next URL found in the HTML. This won't work if there's ever a title that doesn't HAVE a URL link to a studio page.)

Script for 0.9.9.4 and lower is attached. See the other thread for 0.9.9.5 and higher.

Aimhere

[attachment deleted by admin]

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #11 on: April 24, 2009, 05:30:52 am »
Quote
Oh, do I have to???

Yes. All appointments here are for life. Nostra's new picture should offer a clue as to what happens to those who do not cooperate.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Adult.DVDEmpire.com (movies)
« Reply #12 on: April 24, 2009, 11:05:57 am »
 ;D To make it clear: a doomsday machine will be triggered destroying all life on earth  8)
Gentlemen, you can’t fight in here! This is the War Room!

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #13 on: April 24, 2009, 02:42:10 pm »
I was afraid of that.

Offline AimHere

  • Older Power User
  • *****
  • Posts: 213
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #14 on: May 30, 2009, 01:44:16 am »
Just a quick heads-up:

Now that a new stable (?) version of PVD is out, I will no longer maintain a separate version of the ADE script for use with PVD versions below 0.9.9.5.  (I myself have switched to the newest version for my own use, by the way.)

Aimhere

(P.S. - Rick.ca, perhaps this thread ought to be replaced with the one for 0.9.9.5+ now. Or at least merged with it.)

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Adult.DVDEmpire.com (movies)
« Reply #15 on: May 30, 2009, 02:02:23 am »
I think it's OK to have only one version. I want as many users as possible to get the update, so I do not need to support old versions...
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Adult.DVDEmpire.com (movies)
« Reply #16 on: May 30, 2009, 02:05:22 am »
That seems reasonable, Aimhere. Now that 0.9.9.8 is "released," earlier versions (including 0.9.8.20, if the script worked with it) are no longer supported. I'm locking this topic. Please use AdultDVDEmpire script for 0.9.9.5+. Next time you post an update, I suggest you start a new topic. They you will be able post future revisions there by modifying the top/first message. That makes things easier for you and less confusing to users.