(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=J
Title=Adult Video Universe
Description=Script for adult movie information of www.cduniverse.com
Site=www.cduniverse.com
Language=EN
Version=1.0.2 - 04/08/2009
Requires=3.5.0
Comments=V 1.0.0|First Release|V 1.0.1|Added warning page handling
License=This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
GetInfo=1
[Options]
***************************************************)
// Adult Video Universe.com - Script Version 1.0.1 (20090227/J)
//
// v.1.0.1 - 27/02/2002
program ADULTVU;
uses
StringUtils1;
var
MovieName, Value, Value1: string;
procedure AnalyzePage(Address: string);
var
Page: TStringList;
RealAddress, TextEnd, TextBody: string;
Counter: Integer;
begin
Page := TStringList.Create;
Value := '';
Value1 := '';
TextBody := '';
Counter := 0;
// ***** Find movie(s)
begin
Page.Text := GetPage(Address);
PickTreeClear;
Value := Page.Text;
// ***** Warning Page (appears sometimes for the first movie)
If Pos('Warning Page', Page.Text) > 0 then
begin
Value := 'http://www.cduniverse.com/warning' + TextBetween(Page.Text, 'href="warning', '"');
Page.Text := GetPage(Value);
Page.Text := GetPage(Address);
end;
// ***** Collect all search result and choose a title
// Looking for search result(s)
If (Pos('No Title Matches Found', Page.Text) = 0) and (Pos('We could not find', Page.Text) = 0) then
begin
TextBody := TextBetween(Page.Text, 'add to cart', '
');
Value := TextBetween(TextBody, 'a href=', '/a>');
// More than one result?
while Value <> '' do
begin
// Name & real movie URL
RealAddress := 'http://www.cduniverse.com' + TextBetween(Value, '"', '"');
Value := TextBetween(Value, '>', '<');
// if same title exists from different studios then put studionames after title in brackets
Value1 := TextBetween(TextBody, '"> ', '');
if Value1 <> '' then Value := Value + ' (' + Value1 + ')';
PickTreeAdd(Value, RealAddress);
Counter := Counter + 1;
Delete (TextBody, 1 , Pos('img src', TextBody));
Value := TextBetween(TextBody, 'a href=', '/a>');
end;
// Choose movie from list if more than one
If counter > 1 then PickTreeExec(RealAddress);
Page.Text := GetPage(RealAddress);
end
else
// No movie found
begin
ShowMessage('No Title Matches Found.');
Exit;
end;
end;
// ***************** Here we go now with the movie content page
// ***** Title
Value := '';
begin
Value := TextBetween(Page.Text, '