Skip to content

Commit

Permalink
YouTubeVideoUrl: remove InnerTube client API keys
Browse files Browse the repository at this point in the history
As official clients do not use them anymore.
Add prettyPrint parameter in url for minified JSON response.
  • Loading branch information
Taapat committed May 5, 2024
1 parent ed2d5c9 commit 3fa93c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions src/OAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def get_key(x):
API_KEY = get_key('Xhi3_LoIzw_OizD15SyCNReMvKL27nw_OizDWRR395T5uGWpvn451I2VYc78Gy463')
CLIENT_ID = get_key('4113447027255-v15bgs05u1o3m278mpjs2vcd0394w_OizDfrg5160drbw_Oiz63D.w_OizDpp75s.googleus87ercontent.99com')
CLIENT_SECRET = get_key('Zf93pqd2rxgY2ro159rK20BMxif27')
YT_IOSKEY = get_key('Xhi3_LoIzw_OizD15SyB-63vPrd27ThhKuerbB239N_l7Kwwcxj516yUXhi_Loc63')
YT_EMBKEY = get_key('Xhi3_LoIzw_OizD15SyXhi_LoO_27FJ2SlqU8Q439STEHLGCilw51_Y9_11qcW863')
YT_KEY = get_key('Xhi3_LoIzw_OizD15SyXhi_Lo8e27iZmM1Fw_Oi39zDDVjRy-df512KTyQ_vz_y63YM39w')

if path.exists('/etc/enigma2/YouTube.key'): # pragma: no cover
try:
Expand Down
10 changes: 1 addition & 9 deletions src/YouTubeVideoUrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
from .compat import compat_URLError
from .compat import SUBURI
from .jsinterp import JSInterpreter
from .OAuth import YT_IOSKEY
from .OAuth import YT_EMBKEY
from .OAuth import YT_KEY


PRIORITY_VIDEO_FORMAT = ()
Expand Down Expand Up @@ -281,12 +278,7 @@ def _extract_dash_audio_format(self, streaming_formats, player_id):

def _extract_player_response(self, video_id, client):
player_id = None
KEY = {
5: YT_IOSKEY,
30: YT_KEY,
85: YT_EMBKEY
}
url = 'https://www.youtube.com/youtubei/v1/player?key=%s' % KEY[client]
url = 'https://www.youtube.com/youtubei/v1/player?prettyPrint\u003dfalse'
data = {
'videoId': video_id,
'playbackContext': {
Expand Down

0 comments on commit 3fa93c1

Please sign in to comment.