现在还有可用的油管镜像程序吗

  • Post author:
  • Post category:hostloc
  • Post comments:0评论
  • Post last modified:十月 15, 2020

求大佬推荐个可用的,you2php现在是不是停更不能用了。
sun9289 2020-10-15 10:23

https://google.jun8.workers.dev/
这个试试?

MoeWang 2020-10-15 10:23

阿里宝卡的用户吧

sdcumt 2020-10-15 10:23

MoeWang 发表于 2020-10-13 10:29
阿里宝卡的用户吧

嗯嗯,我推荐的程序吗

微程序 2020-10-15 10:23

阿里卡用户

MoeWang 2020-10-15 10:23

sdcumt 发表于 2020-10-13 10:29
嗯嗯,我推荐的程序吗

这个有点难搞,我没有,要不你折腾一下试试国外vps免流

sdcumt 2020-10-15 10:23

MoeWang 发表于 2020-10-13 10:31
这个有点难搞,我没有,要不你折腾一下试试国外vps免流

You2php挺好用的,刚想起来装这个,结果好久没用发现读取不了视频了,作者停更了

jqbaobao 2020-10-15 10:23

Tuber/绿光浏览器即可

sdcumt 2020-10-15 10:23

求推荐

sdcumt 2020-10-15 10:23

jqbaobao 发表于 2020-10-13 11:07
Tuber/绿光浏览器即可

宝卡用户,想用uc,不然直接梯子出去了

yamibox 2020-10-15 10:23

sun9289 发表于 2020-10-13 10:41
https://google.jun8.workers.dev/
这个试试?

大佬,油管的镜像很好用,感谢。就是谷歌镜像站会弹验证,点了之后提示错误。

Geekman 2020-10-15 10:23

sdcumt 发表于 2020-10-13 10:35
You2php挺好用的,刚想起来装这个,结果好久没用发现读取不了视频了,作者停更了 …

以前用这个~ 秒封

Geekman 2020-10-15 10:23

sun9289 发表于 2020-10-13 10:41
https://google.jun8.workers.dev/
这个试试?

老板有源码么

hjvn2211445 2020-10-15 10:23

you2php改一改还可以用的,只是公开了域名就会被dns污染了,被污染太多,不搞了了

花样撸管冠军 2020-10-15 10:23

sun9289 发表于 2020-10-13 10:41
https://google.jun8.workers.dev/
这个试试?

求个码

micms 2020-10-15 10:23

sun9289 发表于 2020-10-13 10:41
https://google.jun8.workers.dev/
这个试试?

哇 请问大佬这种网站怎么做的

robinch 2020-10-15 10:23

sun9289 发表于 2020-10-13 10:41
https://google.jun8.workers.dev/
这个试试?

我自己弄得 老是让我机器人认证  

sdcumt 2020-10-15 10:23

robinch 发表于 2020-10-13 12:37
我自己弄得 老是让我机器人认证

这个牛鼻,不过UC不免流,不知道为啥

sdcumt 2020-10-15 10:23

Geekman 发表于 2020-10-13 11:40
以前用这个~ 秒封

还好吧,我没被封,实在不行套CF

Stelea 2020-10-15 10:23

Geekman 发表于 2020-10-13 11:44
老板有源码么

  1. ‘use strict’
  2. /**
  3. * static files (404.html, sw.js, conf.js)
  4. */
  5. const ASSET_URL = ‘https://etherdream.github.io/jsproxy’
  6. const JS_VER = 10
  7. const MAX_RETRY = 1
  8. /** @type {RequestInit} */
  9. const PREFLIGHT_INIT = {
  10.   status: 204,
  11.   headers: new Headers({
  12.     ‘access-control-allow-origin’: ‘*’,
  13.     ‘access-control-allow-methods’: ‘GET,POST,PUT,PATCH,TRACE,DELETE,HEAD,OPTIONS’,
  14.     ‘access-control-max-age’: ‘1728000’,
  15.   }),
  16. }
  17. /**
  18. * @param {any} body
  19. * @param {number} status
  20. * @param {Object<string, string>} headers
  21. */
  22. function makeRes(body, status = 200, headers = {}) {
  23.   headers[‘–ver’] = JS_VER
  24.   headers[‘access-control-allow-origin’] = ‘*’
  25.   return new Response(body, {status, headers})
  26. }
  27. /**
  28. * @param {string} urlStr
  29. */
  30. function newUrl(urlStr) {
  31.   try {
  32.     return new URL(urlStr)
  33.   } catch (err) {
  34.     return null
  35.   }
  36. }
  37. addEventListener(‘fetch’, e => {
  38.   const ret = fetchHandler(e)
  39.     .catch(err => makeRes(‘cfworker error:\n’ + err.stack, 502))
  40.   e.respondWith(ret)
  41. })
  42. /**
  43. * @param {FetchEvent} e
  44. */
  45. async function fetchHandler(e) {
  46.   const req = e.request
  47.   const urlStr = req.url
  48.   const urlObj = new URL(urlStr)
  49.   const path = urlObj.href.substr(urlObj.origin.length)
  50.   if (urlObj.protocol === ‘http:’) {
  51.     urlObj.protocol = ‘https:’
  52.     return makeRes(”, 301, {
  53.       ‘strict-transport-security’: ‘max-age=99999999; includeSubDomains; preload’,
  54.       ‘location’: urlObj.href,
  55.     })
  56.   }
  57.   if (path.startsWith(‘/http/’)) {
  58.     return httpHandler(req, path.substr(6))
  59.   }
  60.   switch (path) {
  61.   case ‘/http’:
  62.     return makeRes(‘请更新 cfworker 到最新版本!’)
  63.   case ‘/ws’:
  64.     return makeRes(‘not support’, 400)
  65.   case ‘/works’:
  66.     return makeRes(‘it works’)
  67.   default:
  68.     // static files
  69.     return fetch(ASSET_URL + path)
  70.   }
  71. }
  72. /**
  73. * @param {Request} req
  74. * @param {string} pathname
  75. */
  76. function httpHandler(req, pathname) {
  77.   const reqHdrRaw = req.headers
  78.   if (reqHdrRaw.has(‘x-jsproxy’)) {
  79.     return Response.error()
  80.   }
  81.   // preflight
  82.   if (req.method === ‘OPTIONS’ &&
  83.       reqHdrRaw.has(‘access-control-request-headers’)
  84.   ) {
  85.     return new Response(null, PREFLIGHT_INIT)
  86.   }
  87.   let acehOld = false
  88.   let rawSvr = ”
  89.   let rawLen = ”
  90.   let rawEtag = ”
  91.   const reqHdrNew = new Headers(reqHdrRaw)
  92.   reqHdrNew.set(‘x-jsproxy’, ‘1’)
  93.   // 此处逻辑和 http-dec-req-hdr.lua 大致相同
  94.   // https://github.com/EtherDream/jsproxy/blob/master/lua/http-dec-req-hdr.lua
  95.   const refer = reqHdrNew.get(‘referer’)
  96.   const query = refer.substr(refer.indexOf(‘?’) + 1)
  97.   if (!query) {
  98.     return makeRes(‘missing params’, 403)
  99.   }
  100.   const param = new URLSearchParams(query)
  101.   for (const [k, v] of Object.entries(param)) {
  102.     if (k.substr(0, 2) === ‘–‘) {
  103.       // 系统信息
  104.       switch (k.substr(2)) {
  105.       case ‘aceh’:
  106.         acehOld = true
  107.         break
  108.       case ‘raw-info’:
  109.         [rawSvr, rawLen, rawEtag] = v.split(‘|’)
  110.         break
  111.       }
  112.     } else {
  113.       // 还原 HTTP 请求头
  114.       if (v) {
  115.         reqHdrNew.set(k, v)
  116.       } else {
  117.         reqHdrNew.delete(k)
  118.       }
  119.     }
  120.   }
  121.   if (!param.has(‘referer’)) {
  122.     reqHdrNew.delete(‘referer’)
  123.   }
  124.   // cfworker 会把路径中的 `//` 合并成 `/`
  125.   const urlStr = pathname.replace(/^(https?):\/+/, ‘$1://’)
  126.   const urlObj = newUrl(urlStr)
  127.   if (!urlObj) {
  128.     return makeRes(‘invalid proxy url: ‘ + urlStr, 403)
  129.   }
  130.   /** @type {RequestInit} */
  131.   const reqInit = {
  132.     method: req.method,
  133.     headers: reqHdrNew,
  134.     redirect: ‘manual’,
  135.   }
  136.   if (req.method === ‘POST’) {
  137.     reqInit.body = req.body
  138.   }
  139.   return proxy(urlObj, reqInit, acehOld, rawLen, 0)
  140. }
  141. /**
  142. *
  143. * @param {URL} urlObj
  144. * @param {RequestInit} reqInit
  145. * @param {number} retryTimes
  146. */
  147. async function proxy(urlObj, reqInit, acehOld, rawLen, retryTimes) {
  148.   const res = await fetch(urlObj.href, reqInit)
  149.   const resHdrOld = res.headers
  150.   const resHdrNew = new Headers(resHdrOld)
  151.   let expose = ‘*’
  152.   
  153.   for (const [k, v] of resHdrOld.entries()) {
  154.     if (k === ‘access-control-allow-origin’ ||
  155.         k === ‘access-control-expose-headers’ ||
  156.         k === ‘location’ ||
  157.         k === ‘set-cookie’
  158.     ) {
  159.       const x = ‘–‘ + k
  160.       resHdrNew.set(x, v)
  161.       if (acehOld) {
  162.         expose = expose + ‘,’ + x
  163.       }
  164.       resHdrNew.delete(k)
  165.     }
  166.     else if (acehOld &&
  167.       k !== ‘cache-control’ &&
  168.       k !== ‘content-language’ &&
  169.       k !== ‘content-type’ &&
  170.       k !== ‘expires’ &&
  171.       k !== ‘last-modified’ &&
  172.       k !== ‘pragma’
  173.     ) {
  174.       expose = expose + ‘,’ + k
  175.     }
  176.   }
  177.   if (acehOld) {
  178.     expose = expose + ‘,–s’
  179.     resHdrNew.set(‘–t’, ‘1’)
  180.   }
  181.   // verify
  182.   if (rawLen) {
  183.     const newLen = resHdrOld.get(‘content-length’) || ”
  184.     const badLen = (rawLen !== newLen)
  185.     if (badLen) {
  186.       if (retryTimes < MAX_RETRY) {
  187.         urlObj = await parseYtVideoRedir(urlObj, newLen, res)
  188.         if (urlObj) {
  189.           return proxy(urlObj, reqInit, acehOld, rawLen, retryTimes + 1)
  190.         }
  191.       }
  192.       return makeRes(res.body, 400, {
  193.         ‘–error’: `bad len: ${newLen}, except: ${rawLen}`,
  194.         ‘access-control-expose-headers’: ‘–error’,
  195.       })
  196.     }
  197.     if (retryTimes > 1) {
  198.       resHdrNew.set(‘–retry’, retryTimes)
  199.     }
  200.   }
  201.   let status = res.status
  202.   resHdrNew.set(‘access-control-expose-headers’, expose)
  203.   resHdrNew.set(‘access-control-allow-origin’, ‘*’)
  204.   resHdrNew.set(‘–s’, status)
  205.   resHdrNew.set(‘–ver’, JS_VER)
  206.   resHdrNew.delete(‘content-security-policy’)
  207.   resHdrNew.delete(‘content-security-policy-report-only’)
  208.   resHdrNew.delete(‘clear-site-data’)
  209.   if (status === 301 ||
  210.       status === 302 ||
  211.       status === 303 ||
  212.       status === 307 ||
  213.       status === 308
  214.   ) {
  215.     status = status + 10
  216.   }
  217.   return new Response(res.body, {
  218.     status,
  219.     headers: resHdrNew,
  220.   })
  221. }
  222. /**
  223. * @param {URL} urlObj
  224. */
  225. function isYtUrl(urlObj) {
  226.   return (
  227.     urlObj.host.endsWith(‘.googlevideo.com’) &&
  228.     urlObj.pathname.startsWith(‘/videoplayback’)
  229.   )
  230. }
  231. /**
  232. * @param {URL} urlObj
  233. * @param {number} newLen
  234. * @param {Response} res
  235. */
  236. async function parseYtVideoRedir(urlObj, newLen, res) {
  237.   if (newLen > 2000) {
  238.     return null
  239.   }
  240.   if (!isYtUrl(urlObj)) {
  241.     return null
  242.   }
  243.   try {
  244.     const data = await res.text()
  245.     urlObj = new URL(data)
  246.   } catch (err) {
  247.     return null
  248.   }
  249.   if (!isYtUrl(urlObj)) {
  250.     return null
  251.   }
  252.   return urlObj
  253. }

丢到cf workers里就行了。

樯橹 2020-10-15 10:23

大佬牛逼PLUS

869783641 2020-10-15 10:23

jsproxy 挺不错的 要是手机有root可以试试host把cf workers指向到自选ip

发表评论