mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-13 05:37:44 +02:00
Remove dead code
This commit is contained in:
@ -60,8 +60,6 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
|
||||
case cursor
|
||||
when nil, ""
|
||||
ctoken = produce_comment_continuation(id, cursor: "", sort_by: sort_by)
|
||||
# when .starts_with? "Ug"
|
||||
# ctoken = produce_comment_reply_continuation(id, video.ucid, cursor)
|
||||
when .starts_with? "ADSJ"
|
||||
ctoken = produce_comment_continuation(id, cursor: cursor, sort_by: sort_by)
|
||||
else
|
||||
@ -645,38 +643,3 @@ def produce_comment_continuation(video_id, cursor = "", sort_by = "top")
|
||||
|
||||
return continuation
|
||||
end
|
||||
|
||||
def produce_comment_reply_continuation(video_id, ucid, comment_id)
|
||||
object = {
|
||||
"2:embedded" => {
|
||||
"2:string" => video_id,
|
||||
"24:varint" => 1_i64,
|
||||
"25:varint" => 1_i64,
|
||||
"28:varint" => 1_i64,
|
||||
"36:embedded" => {
|
||||
"5:varint" => -1_i64,
|
||||
"8:varint" => 0_i64,
|
||||
},
|
||||
},
|
||||
"3:varint" => 6_i64,
|
||||
"6:embedded" => {
|
||||
"3:embedded" => {
|
||||
"2:string" => comment_id,
|
||||
"4:embedded" => {
|
||||
"1:varint" => 0_i64,
|
||||
},
|
||||
"5:string" => ucid,
|
||||
"6:string" => video_id,
|
||||
"8:varint" => 1_i64,
|
||||
"9:varint" => 10_i64,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
continuation = object.try { |i| Protodec::Any.cast_json(i) }
|
||||
.try { |i| Protodec::Any.from_json(i) }
|
||||
.try { |i| Base64.urlsafe_encode(i) }
|
||||
.try { |i| URI.encode_www_form(i) }
|
||||
|
||||
return continuation
|
||||
end
|
||||
|
@ -20,13 +20,3 @@ def fetch_trending(trending_type, region, locale)
|
||||
|
||||
return {trending, plid}
|
||||
end
|
||||
|
||||
def extract_plid(url)
|
||||
return url.try { |i| URI.parse(i).query }
|
||||
.try { |i| HTTP::Params.parse(i)["bp"] }
|
||||
.try { |i| URI.decode_www_form(i) }
|
||||
.try { |i| Base64.decode(i) }
|
||||
.try { |i| IO::Memory.new(i) }
|
||||
.try { |i| Protodec::Any.parse(i) }
|
||||
.try &.["44:0:embedded"]?.try &.["2:1:string"]?.try &.as_s
|
||||
end
|
||||
|
Reference in New Issue
Block a user