Fix channel extraction when channel URL is youtube.com/c/username

This commit is contained in:
TiA4f8R 2021-04-14 15:01:07 +02:00
parent 991b2c7d73
commit 58ce9b04a1
No known key found for this signature in database
GPG Key ID: E6D3E7F5949450DD
1 changed files with 4 additions and 4 deletions

View File

@ -82,10 +82,10 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
final String channel_path = super.getId();
final String[] channelInfo = channel_path.split("/");
String id = "";
// If the url is an URL with /user, we need to use navigation/resolve_url endpoint of the
// youtubei API to get the channel id. Otherwise, we couldn't get information about the
// channel associated with this username, if there is one.
if (channelInfo[0].equals("user")) {
// If the url is an URL which is not a /channel URL, we need to use the
// navigation/resolve_url endpoint of the youtubei API to get the channel id. Otherwise, we
// couldn't get information about the channel associated with this URL, if there is one.
if (!channelInfo[0].equals("channel")) {
final byte[] body = JsonWriter.string(prepareJsonBuilder()
.value("url", "https://www.youtube.com/" + channel_path)
.done())