diff --git a/src/ya.pl b/src/ya.pl index 6fdaefb..225952b 100755 --- a/src/ya.pl +++ b/src/ya.pl @@ -40,6 +40,11 @@ use constant RENAME_ERRORS_MAX => 5 }; use constant +{ + PLAYLIST_LIKE => 3, + PLAYLIST_LIKE_TITLE => 'Мне нравится' +}; +use constant { DEBUG => 'DEBUG', ERROR => 'ERROR', @@ -684,7 +689,12 @@ sub get_playlist_tracks_info return; } - my $title = $opt{mobile} ? $json->{result}->{title} : $json->{pageData}->{playlist}->{title}; + my $title = $opt{mobile} + ? + ( $opt{playlist} == PLAYLIST_LIKE ? PLAYLIST_LIKE_TITLE : $json->{result}->{title} ) + : + $json->{pageData}->{playlist}->{title}; + if(!$title) { info(DEBUG, 'Can\'t get playlist title');