Update avatar and channel name on video refresh
This commit is contained in:
parent
7efe91e67a
commit
a9657b6fe2
|
@ -2,9 +2,8 @@ package YTYT;
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Data::Dump;
|
||||
use utf8;
|
||||
|
||||
use DBI;
|
||||
use JSON::Any;
|
||||
use WWW::Mechanize;
|
||||
|
@ -94,6 +93,11 @@ sub latest_videos {
|
|||
|
||||
my $content = get_videos_page($self, %params);
|
||||
|
||||
$params{table} = 'channels';
|
||||
$params{channelName} = $content->{metadata}->{channelMetadataRenderer}->{title};
|
||||
$params{channelThumbnail} = $content->{metadata}->{channelMetadataRenderer}->{avatar}->{thumbnails}->[0]->{url};
|
||||
$self->db_update(%params);
|
||||
|
||||
#my $list_ref = $content->{contents}->{twoColumnBrowseResultsRenderer}->{tabs}->[1]->{tabRenderer}->{content}->{sectionListRenderer}->{contents}->[0]->{itemSectionRenderer}->{contents}->[0]->{gridRenderer}->{items};
|
||||
my $list_ref = $content->{contents}->{twoColumnBrowseResultsRenderer}->{tabs}->[1]->{tabRenderer}->{content}->{richGridRenderer}->{contents};
|
||||
my ($offset, $last) = (0, 0);
|
||||
|
|
Loading…
Reference in New Issue