diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2023-06-10 18:07:07 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2023-06-11 16:34:59 +0200 |
| commit | 11ab6ffb32a99df287da0c13f08c8433e6ba067b (patch) | |
| tree | bc8043586e90bcc36ad8afa4854434234f7d0129 /src | |
| parent | 9dd4195dd0089216a42214c7b227398906ad7535 (diff) | |
| download | invidious-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.cr | 44 |
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 |
