Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-EZTV CPAN distribution.

Report information
The Basics
Id: 109105
Status: rejected
Priority: 0/
Queue: WWW-EZTV

People
Owner: Nobody in particular
Requestors: cascardo [...] cascardo.eti.br
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: Thadeu Lima de Souza Cascardo <cascardo [...] cascardo.eti.br>
Subject: [PATCH] Changes URL to eztv.ag and tries to fix DOM parsing.
Date: Wed, 18 Nov 2015 07:25:28 -0200
To: bug-WWW-EZTV [...] rt.cpan.org
From: Thadeu Lima de Souza Cascardo <cascardo [...] cascardo.eti.br>
EZTV domain has changed again to eztv.ag, and its DOM has changed too. The Walking Dead had two different shows, one of them had no episodes, so I used Doctor Who as a test. --- lib/WWW/EZTV.pm | 10 +++++----- lib/WWW/EZTV/Show.pm | 2 +- t/02-find.t | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/WWW/EZTV.pm b/lib/WWW/EZTV.pm index afce7cb..9c3fa3e 100644 --- a/lib/WWW/EZTV.pm +++ b/lib/WWW/EZTV.pm @@ -6,7 +6,7 @@ use WWW::EZTV::Show; # ABSTRACT: EZTV scrapper -has url => ( is => 'ro', lazy => 1, default => sub { Mojo::URL->new('https://eztv.ch/') } ); +has url => ( is => 'ro', lazy => 1, default => sub { Mojo::URL->new('https://eztv.ag/') } ); has url_shows => ( is => 'ro', lazy => 1, default => sub { shift->url->clone->path('/showlist/') } ); has shows => @@ -21,14 +21,14 @@ has shows => sub _build_shows { my $self = shift; - $self->get_response( $self->url_shows )->dom->find('table.header_brd tr[name="hover"]')->map(sub { + $self->get_response($self->url_shows)->dom->find('table tr[name="hover"]')->map(sub { my $tr = shift; - my $link = $tr->at('td:nth-child(2) a'); + my $link = $tr->at('td:nth-child(1) a'); WWW::EZTV::Show->new( title => $link->all_text, url => $self->url->clone->path($link->attr('href')), - status => lc($tr->at('td:nth-child(3)')->all_text), - rating => $tr->at('td:nth-child(4)')->text + 0 + status => lc($tr->at('td:nth-child(2)')->all_text), + rating => $tr->at('td:nth-child(3) b')->text + 0 ); }); } diff --git a/lib/WWW/EZTV/Show.pm b/lib/WWW/EZTV/Show.pm index dc9b44c..75d9953 100644 --- a/lib/WWW/EZTV/Show.pm +++ b/lib/WWW/EZTV/Show.pm @@ -25,7 +25,7 @@ has episodes => sub _build_episodes { my $self = shift; - $self->get_response($self->url)->dom->find('table.header_noborder tr[name="hover"]')->map(sub{ + $self->get_response($self->url)->dom->find('table tr[name="hover"]')->map(sub{ my $tr = shift; my $link = $tr->at('td:nth-child(2) a'); diff --git a/t/02-find.t b/t/02-find.t index ec2de31..5ee3be5 100644 --- a/t/02-find.t +++ b/t/02-find.t @@ -11,19 +11,19 @@ my $show; subtest 'Find a show' => sub { ok( $eztv->has_shows, 'Can fetch shows list' ); - ok( $show = $eztv->find_show(sub{ $_->name =~ /Walking dead/i }), 'Find a known show' ); - is( $show->name, 'The Walking Dead', 'Name looks good' ); + ok( $show = $eztv->find_show(sub{ $_->name =~ /Doctor who/i }), 'Find a known show' ); + is( $show->name, 'Doctor Who', 'Name looks good' ); ok( $show->url, 'Has url ' . $show->url ); ok( $show->status, 'Has status ' . $show->status ); }; subtest 'Find episodes' => sub { ok( $show->has_episodes, 'Show fetch show episodes' ); - ok( my $ep = $show->find_episode(sub{ $_->season == 3 && $_->number == 8 && $_->quality eq 'standard' }), 'Find a known episode' ); + ok( my $ep = $show->find_episode(sub{ $_->season == 9 && $_->number == 9 && $_->quality eq 'standard' }), 'Find a known episode' ); diag( 'Title: ' . $ep->title ); diag( 'Version: ' . $ep->version ); diag( 'Size: ' . $ep->size ); - is( $ep->name, 'The Walking Dead', 'Name looks good' ); + is( $ep->name, 'Doctor Who 2005', 'Name looks good' ); ok( $ep->has_links, 'Episode has links' ); ok( my $link = $ep->find_link(sub{ $_->type eq 'torrent' }), 'Find a torrent link' ); -- 2.6.2
Hi Thadeus, thank you for your interest and this patch. I would be really happy to accept your patch, but please submit it as a issue/pull-request into the official repo: https://github.com/diegok/www-eztv Kindly regards, -dk On Wed Nov 18 04:25:52 2015, cascardo@cascardo.eti.br wrote: Show quoted text
> EZTV domain has changed again to eztv.ag, and its DOM has changed too. > The Walking Dead had two different shows, one of them had no episodes, > so I used Doctor Who as a test. > --- > lib/WWW/EZTV.pm | 10 +++++----- > lib/WWW/EZTV/Show.pm | 2 +- > t/02-find.t | 8 ++++---- > 3 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/lib/WWW/EZTV.pm b/lib/WWW/EZTV.pm > index afce7cb..9c3fa3e 100644 > --- a/lib/WWW/EZTV.pm > +++ b/lib/WWW/EZTV.pm > @@ -6,7 +6,7 @@ use WWW::EZTV::Show; > > # ABSTRACT: EZTV scrapper > > -has url => ( is => 'ro', lazy => 1, default => sub { Mojo::URL-
> >new('https://eztv.ch/') } );
> +has url => ( is => 'ro', lazy => 1, default => sub { Mojo::URL-
> >new('https://eztv.ag/') } );
> has url_shows => ( is => 'ro', lazy => 1, default => sub { shift-
> >url->clone->path('/showlist/') } );
> > has shows => > @@ -21,14 +21,14 @@ has shows => > sub _build_shows { > my $self = shift; > > - $self->get_response( $self->url_shows )->dom-
> >find('table.header_brd tr[name="hover"]')->map(sub {
> + $self->get_response($self->url_shows)->dom->find('table > tr[name="hover"]')->map(sub { > my $tr = shift; > - my $link = $tr->at('td:nth-child(2) a'); > + my $link = $tr->at('td:nth-child(1) a'); > WWW::EZTV::Show->new( > title => $link->all_text, > url => $self->url->clone->path($link->attr('href')), > - status => lc($tr->at('td:nth-child(3)')->all_text), > - rating => $tr->at('td:nth-child(4)')->text + 0 > + status => lc($tr->at('td:nth-child(2)')->all_text), > + rating => $tr->at('td:nth-child(3) b')->text + 0 > ); > }); > } > diff --git a/lib/WWW/EZTV/Show.pm b/lib/WWW/EZTV/Show.pm > index dc9b44c..75d9953 100644 > --- a/lib/WWW/EZTV/Show.pm > +++ b/lib/WWW/EZTV/Show.pm > @@ -25,7 +25,7 @@ has episodes => > > sub _build_episodes { > my $self = shift; > - $self->get_response($self->url)->dom->find('table.header_noborder > tr[name="hover"]')->map(sub{ > + $self->get_response($self->url)->dom->find('table > tr[name="hover"]')->map(sub{ > my $tr = shift; > my $link = $tr->at('td:nth-child(2) a'); > > diff --git a/t/02-find.t b/t/02-find.t > index ec2de31..5ee3be5 100644 > --- a/t/02-find.t > +++ b/t/02-find.t > @@ -11,19 +11,19 @@ my $show; > > subtest 'Find a show' => sub { > ok( $eztv->has_shows, 'Can fetch shows list' ); > - ok( $show = $eztv->find_show(sub{ $_->name =~ /Walking dead/i }), > 'Find a known show' ); > - is( $show->name, 'The Walking Dead', 'Name looks good' ); > + ok( $show = $eztv->find_show(sub{ $_->name =~ /Doctor who/i }), > 'Find a known show' ); > + is( $show->name, 'Doctor Who', 'Name looks good' ); > ok( $show->url, 'Has url ' . $show->url ); > ok( $show->status, 'Has status ' . $show->status ); > }; > > subtest 'Find episodes' => sub { > ok( $show->has_episodes, 'Show fetch show episodes' ); > - ok( my $ep = $show->find_episode(sub{ $_->season == 3 && $_-
> >number == 8 && $_->quality eq 'standard' }), 'Find a known episode'
> ); > + ok( my $ep = $show->find_episode(sub{ $_->season == 9 && $_-
> >number == 9 && $_->quality eq 'standard' }), 'Find a known episode'
> ); > diag( 'Title: ' . $ep->title ); > diag( 'Version: ' . $ep->version ); > diag( 'Size: ' . $ep->size ); > - is( $ep->name, 'The Walking Dead', 'Name looks good' ); > + is( $ep->name, 'Doctor Who 2005', 'Name looks good' ); > > ok( $ep->has_links, 'Episode has links' ); > ok( my $link = $ep->find_link(sub{ $_->type eq 'torrent' }), 'Find a > torrent link' );
Subject: Re: [rt.cpan.org #109105] [PATCH] Changes URL to eztv.ag and tries to fix DOM parsing.
Date: Wed, 18 Nov 2015 11:41:49 -0200
To: Diego Kuperman via RT <bug-WWW-EZTV [...] rt.cpan.org>
From: Thadeu Lima de Souza Cascardo <cascardo [...] cascardo.eti.br>
On Wed, Nov 18, 2015 at 08:21:10AM -0500, Diego Kuperman via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=109105 > > > Hi Thadeus, > > thank you for your interest and this patch. I would be really happy to accept your patch, but please submit it as a issue/pull-request into the official repo: > > https://github.com/diegok/www-eztv > > Kindly regards, > -dk >
Hi, Diego. I don't have and don't intend to have a github account. Is there any way you could accept my patch without requiring me such an account? I could push it to a git repo of my own and send you an email with the branch. Would that be better? I did just that. It's at git://git.cascardo.eti.br/cascardo/www-eztv/ branch master. Thanks for WWW::EZTV and the prompt response. Cascardo.
Download signature.asc
application/pgp-signature 819b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #109105] [PATCH] Changes URL to eztv.ag and tries to fix DOM parsing.
Date: Wed, 18 Nov 2015 14:47:18 +0100
To: bug-WWW-EZTV [...] rt.cpan.org
From: Diego Kuperman <diego [...] freekeylabs.com>
Hi Cascardo, Show quoted text
> On 18 Nov 2015, at 14:42, Thadeu Lima de Souza Cascardo via RT <bug-WWW-EZTV@rt.cpan.org> wrote: > > Queue: WWW-EZTV > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=109105 > > > On Wed, Nov 18, 2015 at 08:21:10AM -0500, Diego Kuperman via RT wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=109105 > >> >> Hi Thadeus, >> >> thank you for your interest and this patch. I would be really happy to accept your patch, but please submit it as a issue/pull-request into the official repo: >> >> https://github.com/diegok/www-eztv >> >> Kindly regards, >> -dk >>
> > Hi, Diego. > > I don't have and don't intend to have a github account. Is there any way > you could accept my patch without requiring me such an account? > > I could push it to a git repo of my own and send you an email with the > branch. Would that be better? > > I did just that. It's at git://git.cascardo.eti.br/cascardo/www-eztv/ > branch master. >
Ok, given your aversion for github I'll pull it from your repo and push it myself ;-) Show quoted text
> Thanks for WWW::EZTV and the prompt response. >
Thank you for using and patching it ;-) -dk