Skip to content

Commit

Permalink
handle user names
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviotordini committed Sep 8, 2020
1 parent 9164746 commit bdf80a6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/channelaggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ void ChannelAggregator::processNextChannel() {

void ChannelAggregator::checkWebPage(YTChannel *channel) {
currentChannel = channel;
QString url = "https://www.youtube.com/channel/" + channel->getChannelId() + "/videos";

QString channelId = channel->getChannelId();
QString url;
if (channelId.startsWith("UC") && !channelId.contains(' ')) {
url = "https://www.youtube.com/channel/" + channelId + "/videos";
} else {
url = "https://www.youtube.com/user/" + channelId + "/videos";
}

QObject *reply = HttpUtils::yt().get(url);

connect(reply, SIGNAL(data(QByteArray)), SLOT(parseWebPage(QByteArray)));
Expand Down

0 comments on commit bdf80a6

Please sign in to comment.