xaicron / p5-www-youtube-download

YouTube video download interface.
http://blog.livedoor.jp/xaicron/
Other
38 stars 28 forks source link

Fix extracting the video title from a playlist #64

Closed SY6Dave closed 3 years ago

SY6Dave commented 3 years ago

See https://github.com/xaicron/p5-www-youtube-download/issues/63

I don't know exactly what $video->{title}->{simpleText} is so I have left that in as a fallback. However when I stepped through this problem in the debugger, I only saw the following keys on $video->{title} : accessibility and runs. The latter was an array containing a single hash reference which contained the text key.

Tested on a few different playlists which all consistently follow this pattern.

See here for the debug info, stepping in after line 549 with a test playlist:

DB<14> x keys %$video
0  'title'
1  'menu'
2  'isPlayable'
3  'thumbnail'
4  'index'
5  'videoId'
6  'trackingParams'
7  'lengthSeconds'
8  'navigationEndpoint'
9  'shortBylineText'
10  'thumbnailOverlays'
11  'lengthText'
  DB<15> x keys %{$video->{title}}
0  'accessibility'
1  'runs'
  DB<16> x $video->{title}
0  HASH(0x55f9e726fa58)
   'accessibility' => HASH(0x55f9e6d16cf0)
      'accessibilityData' => HASH(0x55f9e6d16738)
         'label' => 'Among Us but there is an idiot among us by Call Me Kevin 2 months ago 15 minutes'
   'runs' => ARRAY(0x55f9e6d16b40)
      0  HASH(0x55f9e6d16cc0)
         'text' => 'Among Us but there is an idiot among us'
oalders commented 3 years ago

Thanks for this @SY6Dave!