Fix wrong regex when channel id is at the end of the url

It had no "&" at the end.
This commit is contained in:
Stypox 2019-08-12 16:55:39 +02:00
parent 31e74253f8
commit b09e402d4f
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23

View file

@ -59,7 +59,7 @@ public class YoutubeChannelInfoItemExtractor implements ChannelInfoItemExtractor
String buttonTrackingUrl = el.select("button[class*=\"yt-uix-button\"]").first() String buttonTrackingUrl = el.select("button[class*=\"yt-uix-button\"]").first()
.attr("abs:data-href"); .attr("abs:data-href");
Pattern channelIdPattern = Pattern.compile("(?:.*?)\\%252Fchannel\\%252F(.+?)\\%26(?:.*)"); Pattern channelIdPattern = Pattern.compile("(?:.*?)\\%252Fchannel\\%252F([A-Za-z0-9\\-\\_]+)(?:.*)");
Matcher match = channelIdPattern.matcher(buttonTrackingUrl); Matcher match = channelIdPattern.matcher(buttonTrackingUrl);
if (match.matches()) { if (match.matches()) {