Page 16 of 34

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-13 18:08:49
by admas
Ok, zwiastuny działają. Dzięki.

W serialach dane były pobierane w ten sposób:

- sezon 1

1 - Pilot 17.01.2016,
2 - Naming Rights 24.01.2016,
itd.

Data premiery odcinka była światowa.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-14 15:28:16
by athe
Witam. Na stronie widzę, że odcinki są prezentowane od najnowszego sezonu. Może tak być? Trochę to potrwa bo są jeszcze odcinki specjalne, a do nich nie ma żadnego odnośnika.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-14 18:54:21
by admas
Może tak być. Odcinki specjalne to nie problem, nie muszą być, jest ich zazwyczaj 1-2 więc jeśli są potrzebne, to można wstawić ręcznie.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-15 06:21:31
by athe
Niebawem wrzucę część skryptu odpowiadającą za odcinki

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-16 21:05:57
by athe
Sprawdźcie proszę czy to u Was działa. Gdy sprawdziłem u siebie, działa poprawnie. Gdyby były jakieś uwagi dajcie znać. Musiałem dodać dwie zmienne Numer i NumerP, do sprawdzania numeru sezonu. Nie ma odnośnika do odcinków specjalnych i nie miałem skąd wziąć tych danych. Oto cała część skryptu odpowiadająca za pobieranie odcinków:

Code: Select all

procedure PobierzOdcinki(Address : String);
var
	Line, Line2, Value, Numer, NumerP, Sezon, Odcinek, Tytul, Data : String;
	Page : TStringList;
begin
	Page := TStringList.Create;
	Page.Text := UTF8Decode(GetPage(Address));
	Line := TextBetween(Page.Text, 'serialInfoBar__list', 'episodesSection__options');
	while (Pos('serialInfoBar__element', Line) > 0) do
		begin
  Numer := TextBetween(Line, 'data-element-id="', '"');
	Odcinek := 'https://www.filmweb.pl' + TextBetween(Line, 'href="', '"');
  Odcinek := GetPage(Odcinek);
  Line2 :=  TextBetween(Odcinek, 'episodesSection__resultsList', '></div><script');
  NumerP := TextBetween(Line2, 'data-element-number="', '"');
   while NumerP <> Numer do
   begin
  Line2 := Copy(Line2, Pos('data-element-number', Line2) + Length('data-element-number'), Length(Line2));
  NumerP := TextBetween(Line2, 'data-element-number="', '"');
  end;
   begin
      Odcinek := TextBetween(Line2, 'data-element-number="', 'episodesContainer__voteSection');
      Sezon := TextBetween(Odcinek, 'episodesContainer__title">', '<') + ' ' + TextBetween(Odcinek, 'episodesContainer__year">', '<');
      Value := Value + Sezon + #13#10;
    while (Pos('episode__title', Line2) > 0) do
      begin
      	Odcinek := TextBetween(Line2, 'episode__details', 'if(typeof Handlebars');
      	Tytul := TextBetween(Odcinek, 'episode__title">', '</div>');
      	Data := TextBetween(Odcinek, 'firstDate">', '</span');
      	Value := Value + Tytul + ' (' + Data + ')' + #13#10;
	Line2 := Copy(Line2, Pos('episode__title', Line2) + Length('episode__tittle'), Length(Line2));
       end;
     end;
			Value := Value + #13#10;
			Line:= Copy(Line, Pos('</li>', Line) + Length('</li>'), Length(Line));
     		      end;
	if (Value <> '') then
	begin
		HTMLRemoveTags(Value);
		if (not ((AUpdate = 2) and (GetCustomField('Odcinki')=Trim(Value)))) then SetCustomField('Odcinki', Trim(Value));
 	end;
	Page.Free;
end;
Pozdrawiam

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-17 09:22:23
by admas
Wydaje się działać poprawnie z serialami o wielu sezonach - sprawdziłem na 10; jest problem z serialami z jednym sezonem, gdzie są na stronie głównej podane lata zamiast numerów sezonów, np.

https://www.filmweb.pl/Kompania.Braci
lata: 2001

https://www.filmweb.pl/serial/Spartakus ... 011-588273
lata: 2011

Ale to drobnostka

Dzięki za aktualne poprawki :grinking:

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-18 20:08:16
by athe
Poprawka tak na szybko. Działa również z jednym sezonem gdy jest podany tylko rok. Cała część skryptu odpowiedzialna za pobranie odcinków

Code: Select all

procedure PobierzOdcinki(Address : String);
var
	Line, Line2, Value, Numer, NumerP, Sezon, Odcinek, Tytul, Data : String;
	Page : TStringList;
begin
	Page := TStringList.Create;
	Page.Text := UTF8Decode(GetPage(Address));
	Line := TextBetween(Page.Text, 'serialInfoBar__list', 'episodesSection__options');
  if (length(Line) > 0) then
  begin
	while (Pos('serialInfoBar__element', Line) > 0) do
		begin
  Numer := TextBetween(Line, 'data-element-id="', '"');
	Odcinek := 'https://www.filmweb.pl' + TextBetween(Line, 'href="', '"');
  Odcinek := GetPage(Odcinek);
  Line2 :=  TextBetween(Odcinek, 'episodesSection__resultsList', '></div><script');
  NumerP := TextBetween(Line2, 'data-element-number="', '"');
   while NumerP <> Numer do
   begin
  Line2 := Copy(Line2, Pos('data-element-number', Line2) + Length('data-element-number'), Length(Line2));
  NumerP := TextBetween(Line2, 'data-element-number="', '"');
   end;
   begin
      Odcinek := TextBetween(Line2, 'data-element-number="', 'episodesContainer__voteSection');
      Sezon := TextBetween(Odcinek, 'episodesContainer__title">', '<') + ' ' + TextBetween(Odcinek, 'episodesContainer__year">', '<');
   		Value := Value + Sezon + #13#10;
    while (Pos('episode__title', Line2) > 0) do
      begin
      Odcinek := TextBetween(Line2, 'episode__details', 'if(typeof Handlebars');
      Tytul := TextBetween(Odcinek, 'episode__title">', '</div>');
      Data := TextBetween(Odcinek, 'firstDate">', '</span');
      Value := Value + Tytul + ' (' + Data + ')' + #13#10;
	    Line2 := Copy(Line2, Pos('episode__title', Line2) + Length('episode__tittle'), Length(Line2));
			end;
	 end;
			Value := Value + #13#10;
			Line:= Copy(Line, Pos('</li>', Line) + Length('</li>'), Length(Line));
    end;
      end;
    if Line = '' then
 begin
   Sezon := TextBetween(Page.Text, 'span class="halfSize', 'h2 class="cap s-16 top-5');
   Sezon := TextBetween(Sezon, '">', '<');
   Value := Value + Sezon + #13#10;
   Line2 := TextBetween(Page.Text, 'episodesSection__resultsList', '></div><script');
  while (Pos('episode__title', Line2) > 0) do
       begin
      Tytul := TextBetween(Line2, 'episode__title">', '</div>');
      Data := TextBetween(Line2, 'firstDate">', '</span');
      Value := Value + Tytul + ' (' + Data + ')' + #13#10;
	    Line2 := Copy(Line2, Pos('episode__title', Line2) + Length('episode__title'), Length(Line2));
			end;
   end;
	if (Value <> '') then
	begin
		HTMLRemoveTags(Value);
		if (not ((AUpdate = 2) and (GetCustomField('Odcinki')=Trim(Value)))) then SetCustomField('Odcinki', Trim(Value));
	end;
	Page.Free;
end;
Pozdrawiam.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-04-19 06:48:23
by admas
Teraz pobiera wszystkie, dzięki. Miałbym jedną uwagę, można dodać Ep. przed nr odcinka

Code: Select all

      Value := Value + 'Ep. ' + Tytul +  ' (' + Data + ')' + #13#10;
Wtedy będzie to miało taką postać:
Ep. 1 - Smoke (6.08.2018)
Ep. 2 - Breathe (13.08.2018)
Ep. 3 - Something Beautiful (20.08.2018)
Ep. 4 - Talk (27.08.2018)

Dzięki za szybką reakcję i poprawki :clapping:

Pozdrawiam i Wesołych Świąt życzę :)

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-06-26 17:54:43
by goblin21
Pole Dystrybucja pobierane jest do postaci:

Code: Select all

<a href="http://www.kinoswiat.pl" target="_blank" rel="nofollow">Kino Świat</a>
Dodatkowo przy każdym pobieraniu danych z Filmweb, wyskakuje błąd IOHandler value is not valid

Script version=3.0.5b (25.01.2019)

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-06-26 19:31:58
by athe
Może podaj link do tego filmu gdzie masz ten błąd z pobraniem dystrybucji.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-07-03 13:40:15
by goblin21
Z filmu: https://www.filmweb.pl/film/W ciemności-2011-525620 pobiera

Code: Select all

<a href="http://www.kinoswiat.pl" target="_blank" rel="nofollow">Kino Świat</a>
z https://www.filmweb.pl/film/I Love You ... 009-444424

Code: Select all

<a href="http://www.monolith.pl" target="_blank" rel="nofollow">Monolith Films</a>
z https://www.filmweb.pl/film/Prawie jak ... 012-626720

Code: Select all

<a href="http://www.forumfilm.pl/" target="_blank" rel="nofollow">Forum Film Poland Sp. z o.o.</a>
z https://www.filmweb.pl/film/U Pana Boga ... 007-331270

Code: Select all

<a href="http://www.vision.pl" target="_blank" rel="nofollow">Vision Film Distribution</a>
ale z https://www.filmweb.pl/film/Dzień dobry TV-2010-487563 pobiera United International Pictures Sp z o.o.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-07-03 19:05:45
by athe
Jeżeli dasz radę to w procedurze pobierania dystrybucji trzeba dopisać linię:

Code: Select all

HTMLRemoveTags(Value);
Ma to wyglądać tak:

Code: Select all

if ((Pos('<dt>dystrybucja:</dt>', Page.Text) > 0) and (CanSetCustomField('Dystrybucja')))  then
			begin
				Value := '';
				Value := TextBetween(Page.Text, '<dt>dystrybucja:</dt><dd>', '</dd>');
				if (Value <> '') then
				begin
         				HTMLRemoveTags(Value);
					Value := Trim(Value);
					if (not ((AUpdate = 2) and (GetCustomField('Dystrybucja')=Value))) then SetCustomField('Dystrybucja', Trim(Value));

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-07-13 14:05:47
by goblin21
Dzięki, działa jak trzeba.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-08-14 13:20:15
by robinse
Program nie pobiera mi komentarzy....... :/

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-08-18 07:14:21
by athe
Mógłbyś podać link do filmu gdzie jest ten problem?

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-09-21 09:34:24
by lucas7911
Bardzo błahy problem podczas pobierania tytułów z bazy Filmweb pobiera mi tylko 10 z np: 882 znalezionych, mam oczywiście przycisk "znajdź więcej" ale jest nieaktywny jak powiększyć listę znalezionych tytułów

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-09-23 06:41:23
by athe
Jaką masz ustawioną wartość dla LimitWyników w opcjach skryptu? Jeżeli wartość=1 to pobierze Ci 10 tytułów. Pozdrawiam

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-09-23 10:35:41
by lucas7911
A dziękuje nie pomyśłałem o tym , na razie ustawiłem wartość "2"

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-10-21 11:24:06
by athe
Witam. Nie wiem czy zauważyliście, że przy pobieraniu twórców są błędy, chodzi o prawidłowe odczytanie zmiennej 'Typ'. Jako dźwiękowców pobierane były osoboby ze scenografii, producentów itd. Żeby zapobiec temu należy w funkcji

Code: Select all

function GetMaterialsFormatCrews
wpisać linię:

Code: Select all

Typ := TextBetween(Line, 'data-roletype\x3d"', '"');
a starą wyłączyć. Ma to wyglądać tak:

Code: Select all

 Line := Copy(Line, Pos('pn:"', Line), Length(Line));
    Actor := TextBetween(Line, 'pn:"', '"');
   // Typ := TextBetween(Line, 'pr:"', '"');
    Typ := TextBetween(Line, 'data-roletype\x3d"', '"');
    CorrectTextError(Actor);
Mam nadzieję, że komuś się przyda, pozdrawiam.

Re: [REL] [PL] FilmWeb.pl 3.0 - The Best Polish Script

Posted: 2019-11-06 05:59:48
by gregorcio
Proszę o nowy script bo wszystko sie sypie