summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2023-06-10 18:07:07 +0200
committerSamantaz Fox <coding@samantaz.fr>2023-06-11 16:34:59 +0200
commit11ab6ffb32a99df287da0c13f08c8433e6ba067b (patch)
treebc8043586e90bcc36ad8afa4854434234f7d0129 /src
parent9dd4195dd0089216a42214c7b227398906ad7535 (diff)
downloadinvidious-11ab6ffb32a99df287da0c13f08c8433e6ba067b.tar.gz
invidious-11ab6ffb32a99df287da0c13f08c8433e6ba067b.tar.bz2
invidious-11ab6ffb32a99df287da0c13f08c8433e6ba067b.zip
User: Remove broken Google login (notifications route)
Diffstat (limited to 'src')
-rw-r--r--src/invidious/routes/notifications.cr44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/invidious/routes/notifications.cr b/src/invidious/routes/notifications.cr
index 272a3dc7..8922b740 100644
--- a/src/invidious/routes/notifications.cr
+++ b/src/invidious/routes/notifications.cr
@@ -24,50 +24,6 @@ module Invidious::Routes::Notifications
user = user.as(User)
- if !user.password
- channel_req = {} of String => String
-
- channel_req["receive_all_updates"] = env.params.query["receive_all_updates"]? || "true"
- channel_req["receive_no_updates"] = env.params.query["receive_no_updates"]? || ""
- channel_req["receive_post_updates"] = env.params.query["receive_post_updates"]? || "true"
-
- channel_req.reject! { |k, v| v != "true" && v != "false" }
-
- headers = HTTP::Headers.new
- headers["Cookie"] = env.request.headers["Cookie"]
-
- html = YT_POOL.client &.get("/subscription_manager?disable_polymer=1", headers)
-
- cookies = HTTP::Cookies.from_client_headers(headers)
- html.cookies.each do |cookie|
- if {"VISITOR_INFO1_LIVE", "YSC", "SIDCC"}.includes? cookie.name
- if cookies[cookie.name]?
- cookies[cookie.name] = cookie
- else
- cookies << cookie
- end
- end
- end
- headers = cookies.add_request_headers(headers)
-
- if match = html.body.match(/'XSRF_TOKEN': "(?<session_token>[^"]+)"/)
- session_token = match["session_token"]
- else
- return env.redirect referer
- end
-
- headers["content-type"] = "application/x-www-form-urlencoded"
- channel_req["session_token"] = session_token
-
- subs = XML.parse_html(html.body)
- subs.xpath_nodes(%q(//a[@class="subscription-title yt-uix-sessionlink"]/@href)).each do |channel|
- channel_id = channel.content.lstrip("/channel/").not_nil!
- channel_req["channel_id"] = channel_id
-
- YT_POOL.client &.post("/subscription_ajax?action_update_subscription_preferences=1", headers, form: channel_req)
- end
- end
-
if redirect
env.redirect referer
else