mirror of
https://github.com/iv-org/invidious.git
synced 2025-01-03 13:41:47 +05:30
Compare commits
4 Commits
701f03d5e8
...
3450896602
Author | SHA1 | Date | |
---|---|---|---|
|
3450896602 | ||
|
4195dcd3cf | ||
|
2f6b2688bb | ||
|
0d27eef047 |
@ -1,5 +1,9 @@
|
|||||||
version: 2.0
|
version: 2.0
|
||||||
shards:
|
shards:
|
||||||
|
ameba:
|
||||||
|
git: https://github.com/crystal-ameba/ameba.git
|
||||||
|
version: 1.5.0
|
||||||
|
|
||||||
athena-negotiation:
|
athena-negotiation:
|
||||||
git: https://github.com/athena-framework/negotiation.git
|
git: https://github.com/athena-framework/negotiation.git
|
||||||
version: 0.1.1
|
version: 0.1.1
|
||||||
@ -44,6 +48,3 @@ shards:
|
|||||||
git: https://github.com/crystal-lang/crystal-sqlite3.git
|
git: https://github.com/crystal-lang/crystal-sqlite3.git
|
||||||
version: 0.18.0
|
version: 0.18.0
|
||||||
|
|
||||||
ameba:
|
|
||||||
git: https://github.com/crystal-ameba/ameba.git
|
|
||||||
version: 0.14.3
|
|
||||||
|
@ -3,7 +3,7 @@ version: 0.20.1
|
|||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Omar Roth <omarroth@protonmail.com>
|
- Omar Roth <omarroth@protonmail.com>
|
||||||
- Invidous team
|
- Invidious team
|
||||||
|
|
||||||
targets:
|
targets:
|
||||||
invidious:
|
invidious:
|
||||||
@ -35,7 +35,7 @@ development_dependencies:
|
|||||||
version: ~> 0.10.4
|
version: ~> 0.10.4
|
||||||
ameba:
|
ameba:
|
||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
version: ~> 0.14.3
|
version: ~> 1.5.0
|
||||||
|
|
||||||
crystal: ">= 1.0.0, < 2.0.0"
|
crystal: ">= 1.0.0, < 2.0.0"
|
||||||
|
|
||||||
|
@ -55,8 +55,9 @@ def extract_video_info(video_id : String, proxy_region : String? = nil)
|
|||||||
client_config = YoutubeAPI::ClientConfig.new(proxy_region: proxy_region)
|
client_config = YoutubeAPI::ClientConfig.new(proxy_region: proxy_region)
|
||||||
|
|
||||||
# Fetch data from the player endpoint
|
# Fetch data from the player endpoint
|
||||||
# 8AEB param is used to fetch YouTube stories
|
# CgIQBg is a workaround for streaming URLs that returns a 403.
|
||||||
player_response = YoutubeAPI.player(video_id: video_id, params: "8AEB", client_config: client_config)
|
# See https://github.com/iv-org/invidious/issues/4027#issuecomment-1666944520
|
||||||
|
player_response = YoutubeAPI.player(video_id: video_id, params: "CgIQBg", client_config: client_config)
|
||||||
|
|
||||||
playability_status = player_response.dig?("playabilityStatus", "status").try &.as_s
|
playability_status = player_response.dig?("playabilityStatus", "status").try &.as_s
|
||||||
|
|
||||||
@ -135,8 +136,9 @@ end
|
|||||||
|
|
||||||
def try_fetch_streaming_data(id : String, client_config : YoutubeAPI::ClientConfig) : Hash(String, JSON::Any)?
|
def try_fetch_streaming_data(id : String, client_config : YoutubeAPI::ClientConfig) : Hash(String, JSON::Any)?
|
||||||
LOGGER.debug("try_fetch_streaming_data: [#{id}] Using #{client_config.client_type} client.")
|
LOGGER.debug("try_fetch_streaming_data: [#{id}] Using #{client_config.client_type} client.")
|
||||||
# 8AEB param is used to fetch YouTube stories
|
# CgIQBg is a workaround for streaming URLs that returns a 403.
|
||||||
response = YoutubeAPI.player(video_id: id, params: "8AEB", client_config: client_config)
|
# See https://github.com/iv-org/invidious/issues/4027#issuecomment-1666944520
|
||||||
|
response = YoutubeAPI.player(video_id: id, params: "CgIQBg", client_config: client_config)
|
||||||
|
|
||||||
playability_status = response["playabilityStatus"]["status"]
|
playability_status = response["playabilityStatus"]["status"]
|
||||||
LOGGER.debug("try_fetch_streaming_data: [#{id}] Got playabilityStatus == #{playability_status}.")
|
LOGGER.debug("try_fetch_streaming_data: [#{id}] Got playabilityStatus == #{playability_status}.")
|
||||||
|
Loading…
Reference in New Issue
Block a user