Skip to content

Commit

Permalink
need modify param &n=
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexterr-origin committed Jun 22, 2021
1 parent c78b16d commit c44a754
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions YT.lua
@@ -1,4 +1,4 @@
-- видеоскрипт для сайта https://www.youtube.com (20/6/21)
-- видеоскрипт для сайта https://www.youtube.com (23/6/21)
-- https://github.com/Nexterr-origin/simpleTV-YouTube
--[[
Copyright © 2017-2021 Nexterr
Expand Down Expand Up @@ -1176,7 +1176,8 @@ https://github.com/grafi-tt/lunaJson
end
codec = table.concat(t)
end
local dur, publishedAt, author
local dur, author
local publishedAt = ''
if m_simpleTV.User.YT.isLive == true then
dur = ''
author = m_simpleTV.User.YT.Lng.live .. ' | '
Expand All @@ -1185,8 +1186,9 @@ https://github.com/grafi-tt/lunaJson
local timeSt = timeStamp(m_simpleTV.User.YT.actualStartTime)
timeSt = os.date('%y %d %m %H %M', tonumber(timeSt))
local year, day, month, hour, min = timeSt:match('(%d+) (%d+) (%d+) (%d+) (%d+)')
publishedAt = m_simpleTV.User.YT.Lng.started .. ': '
.. string.format('%d:%02d (%d/%d/%02d)', hour, min, day, month, year)
if year and month and day and hour and min then
publishedAt = m_simpleTV.User.YT.Lng.started .. ': ' .. string.format('%d:%02d (%d/%d/%02d)', hour, min, day, month, year)
end
else
dur = m_simpleTV.User.YT.Lng.duration .. ': ' .. secondsToClock(m_simpleTV.User.YT.duration)
author = m_simpleTV.User.YT.Lng.upLoadOnCh .. ': ' .. m_simpleTV.User.YT.author
Expand Down Expand Up @@ -1443,7 +1445,7 @@ https://github.com/grafi-tt/lunaJson
local origin = 'https://www.youtube.com'
local toHash = string.format('%s %s %s', ostime, m_simpleTV.User.YT.isAuth, origin)
local hash = m_simpleTV.Common.CryptographicHash(toHash, 'Sha1', true)
return string.format('Authorization: SAPISIDHASH %s_%s', ostime, hash)
return string.format('Authorization: SAPISIDHASH %s_%s\nX-Goog-AuthUser: 0', ostime, hash)
end
return ''
end
Expand Down Expand Up @@ -2029,9 +2031,9 @@ https://github.com/grafi-tt/lunaJson
m_simpleTV.Http.SetTimeout(session_videoInfo, 8000)
clientScreen = clientScreen or 'WATCH'
local sts = m_simpleTV.User.YT.sts or 0
local thirdParty = urlAdr:match('$OPT:http%-referrer=([^%$&]+)') or ''
local headers = header_Auth() .. '\nX-Goog-AuthUser: 0\nOrigin: https://www.youtube.com\nContent-Type: application/json'
local body = string.format('{"videoId":"%s","context":{"client":{"hl":"%s","gl":"US","clientName":"WEB","clientVersion": "2.20210617.01.00","clientScreen":"%s"},"thirdParty":{"embedUrl":"%s"}},"playbackContext":{"contentPlaybackContext":{"signatureTimestamp":%s}}}', m_simpleTV.User.YT.vId, m_simpleTV.User.YT.Lng.hl, clientScreen, thirdParty, sts)
local thirdParty = urlAdr:match('$OPT:http%-referrer=([^%$]+)') or ''
local headers = header_Auth() .. '\nOrigin: https://www.youtube.com\nContent-Type: application/json'
local body = string.format('{"videoId":"%s","context":{"client":{"hl":"%s","gl":"US","clientName":"WEB","clientVersion": "2.20210617.01.00","clientScreen":"%s","webpSupport":false},"thirdParty":{"embedUrl":"%s"}},"playbackContext":{"contentPlaybackContext":{"signatureTimestamp":%s}}}', m_simpleTV.User.YT.vId, m_simpleTV.User.YT.Lng.hl, clientScreen, thirdParty, sts)
local url = 'https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8'
m_simpleTV.Http.SetCookies(session_videoInfo, url, m_simpleTV.User.YT.cookies, '')
local rc, answer = m_simpleTV.Http.Request(session_videoInfo, {url = url, method = 'post', body = body, headers = headers})
Expand Down Expand Up @@ -2827,7 +2829,7 @@ https://github.com/grafi-tt/lunaJson
end
local FilterType, AutoNumberFormat, Random, PlayMode
if #tab > 2 then
if #tab < 15 then
if #tab < 5 then
FilterType = 2
else
FilterType = 1
Expand Down

0 comments on commit c44a754

Please sign in to comment.