diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-05-03 20:37:17 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-05-03 20:37:17 -0500 |
| commit | d1841b9be584dbd66148f77a3cb752a24a7e7ba3 (patch) | |
| tree | 7fe1c5230343192cd1902432e7eb7bffab3d9554 /src/helpers.cr | |
| parent | 6d3e88aeb52ebfc89f9d78d6dbfd2dab1f1b59d3 (diff) | |
| download | invidious-d1841b9be584dbd66148f77a3cb752a24a7e7ba3.tar.gz invidious-d1841b9be584dbd66148f77a3cb752a24a7e7ba3.tar.bz2 invidious-d1841b9be584dbd66148f77a3cb752a24a7e7ba3.zip | |
Use sidebar for pulling subscriptions
Diffstat (limited to 'src/helpers.cr')
| -rw-r--r-- | src/helpers.cr | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/helpers.cr b/src/helpers.cr index 34224e24..4d725e19 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -621,11 +621,13 @@ def fetch_user(sid, client, headers) feed = XML.parse_html(feed.body) channels = [] of String - feed.xpath_nodes(%q(//a[@class="subscription-title yt-uix-sessionlink"]/@href)).each do |channel| - channel_id = channel.content.lstrip("/channel/").not_nil! - get_channel(channel_id, client, PG_DB) + feed.xpath_nodes(%q(//ul[@id="guide-channels"]/li/a)).each do |channel| + if !["Popular on YouTube", "Music", "Sports", "Gaming"].includes? channel["title"] + channel_id = channel["href"].lstrip("/channel/").not_nil! + get_channel(channel_id, client, PG_DB) - channels << channel_id + channels << channel_id + end end email = feed.xpath_node(%q(//a[@class="yt-masthead-picker-header yt-masthead-picker-active-account"])) |
