Greasy Fork is available in English.

YouTube JS Engine Tamer

To enhance YouTube performance by modifying YouTube JS Engine

< Feedback on YouTube JS Engine Tamer

Review: Good - script works

§
Posted: 10-04-2024

不好意思,和廣告攔截腳本同時開後導致畫面黑,F5的瞬間能看到封面
https://greasyfork.org/zh-TW/scripts/480192
由於兩邊都剛更新過,無法確定哪邊衝突不好意思,先問看看。
倒退歷史版本也一樣會黑畫面
目前CHROME和CENT都會這樣

§
Posted: 10-04-2024

其他擴充套件,腳本都關掉

  1. 只把這個YouTube JS Engine Tamer打開,會黑掉嗎
  2. 只把這個YouTube JS Engine Tamer和"廣告攔截腳本"打開,會黑掉嗎
  3. 只把"廣告攔截腳本"打開,會黑掉嗎
§
Posted: 10-04-2024

測試出來了。有衝突,待解決

§
Posted: 10-04-2024

已解決,請更新

§
Posted: 11-04-2024
Edited: 11-04-2024

不好意思昨天沒寫詳細。
只有兩個同時打開才會黑掉,其他腳本都關閉了
感謝作者的辛勞
YA!
順利觀看中

§
Posted: 12-04-2024

不好意思回報,還有個小bug,影片切換到背景頁後,無法繼續讀取緩衝,直播讀取正常
(但如果讀取第二段緩衝後,才切換背景頁,就可正常讀取)
(只有同時打開上面寫的攔截腳本)
(另外多重測試後,發覺攔截腳本1.1.6版本不會停止,1.1.7以後才會無法讀取緩衝)
測試影片【歌ってみた】ギフト / 内緒のピアス cover by TanZ
https://www.youtube.com/watch?v=0aIzfekltOM

打完發覺有點複雜...我不要同時開兩個腳本好了

§
Posted: 12-04-2024
Edited: 12-04-2024
  1. 把那個腳本的這部份刪掉
    unsafeWindow.fetch = function () {
        const fetch_ = async function (uri, options) {
            async function fetch_request(response) {
                let url = response.url
                inject_info.fetch = true
                return_response = response
                if (url.indexOf('youtubei/v1/next') > -1) {
                    return await deal_resposn('next', response, watch_page_ytInitialData_ad_rule)
                }
                if (url.indexOf('youtubei/v1/player') > -1) {
                    return await deal_resposn('player', response, ytInitialPlayerResponse_ad_rule)
                }
                if (url.indexOf('youtubei/v1/browse') > -1) {
                    let rule = home_page_ytInitialData_ad_rule
                    if (page_type === 'home' && !user_data.open_recommend_liveroom) {
                        let node, category_text
                        if (mobile_web) {
                            node = document.querySelector('#filter-chip-bar > div > ytm-chip-cloud-chip-renderer.selected')
                            category_text = node && node.textContent
                        } else {
                            node = document.querySelector('#chips > yt-chip-cloud-chip-renderer.style-scope.ytd-feed-filter-chip-bar-renderer.iron-selected')
                            category_text = node && node.querySelector('#text').textContent
                        }
                        const filter_list = [flag_info.category_game, flag_info.category_live, flag_info.category_news]
                        if (filter_list.includes(category_text)) {
                            let body
                            if (uri.body_) {
                                try {
                                    body = JSON.parse(uri.body_)
                                } catch (error) {
                                }
                            }
                            if (!body || body.browseId !== 'FEwhat_to_watch') {
                                rule = home_page_ytInitialData_ad_rule.filter(item => item.indexOf(flag_info.live) === -1)
                            }
                        }
                    }
                    return await deal_resposn('browse', response, rule)
                }
                if (url.indexOf('https://m.youtube.com/youtubei/v1/guide') > -1) {
                    return await deal_resposn('guide', response, home_page_ytInitialData_ad_rule)
                }
                if (url.indexOf('/youtubei/v1/search') > -1) {
                    return await deal_resposn('guide', response, home_page_ytInitialData_ad_rule)
                }
                if (url.indexOf('/unsubscribe?prettyPrint=false') > -1) {
                    return await deal_resposn('unsubscribe', response)
                }
                if (url.indexOf('/subscribe?prettyPrint=false') > -1) {
                    return await deal_resposn('subscribe', response)
                }
                return return_response
            }

            return origin_fetch(uri, options).then(fetch_request)
        }
        const names = Object.getOwnPropertyNames(origin_fetch);
        for (let i = 0; i < names.length; i++) {
            if (names[i] in fetch_)
                continue;
            let desc = Object.getOwnPropertyDescriptor(origin_fetch, names[i])
            define_property_hook(fetch_, names[i], desc);
        }
        return fetch_
    }()
  1. 還是不行的話,加回去,改成
    unsafeWindow.fetch = function () {
        const fetch_ = async function (uri, options) {
            async function fetch_request(response) {
                let url = response.url
                inject_info.fetch = true
                return_response = response
                if (url.indexOf('youtubei/v1/next') > -1) { 
                }
                if (url.indexOf('youtubei/v1/player') > -1) { 
                }
                if (url.indexOf('youtubei/v1/browse') > -1) {
                    let rule = home_page_ytInitialData_ad_rule
                    if (page_type === 'home' && !user_data.open_recommend_liveroom) {
                        let node, category_text
                        if (mobile_web) {
                            node = document.querySelector('#filter-chip-bar > div > ytm-chip-cloud-chip-renderer.selected')
                            category_text = node && node.textContent
                        } else {
                            node = document.querySelector('#chips > yt-chip-cloud-chip-renderer.style-scope.ytd-feed-filter-chip-bar-renderer.iron-selected')
                            category_text = node && node.querySelector('#text').textContent
                        }
                        const filter_list = [flag_info.category_game, flag_info.category_live, flag_info.category_news]
                        if (filter_list.includes(category_text)) {
                            let body
                            if (uri.body_) {
                                try {
                                    body = JSON.parse(uri.body_)
                                } catch (error) {
                                }
                            }
                            if (!body || body.browseId !== 'FEwhat_to_watch') {
                                rule = home_page_ytInitialData_ad_rule.filter(item => item.indexOf(flag_info.live) === -1)
                            }
                        }
                    } 
                }
                if (url.indexOf('https://m.youtube.com/youtubei/v1/guide') > -1) { 
                }
                if (url.indexOf('/youtubei/v1/search') > -1) { 
                }
                if (url.indexOf('/unsubscribe?prettyPrint=false') > -1) { 
                }
                if (url.indexOf('/subscribe?prettyPrint=false') > -1) { 
                }
                return return_response
            }

            return origin_fetch(uri, options).then(fetch_request)
        }
        const names = Object.getOwnPropertyNames(origin_fetch);
        for (let i = 0; i < names.length; i++) {
            if (names[i] in fetch_)
                continue;
            let desc = Object.getOwnPropertyDescriptor(origin_fetch, names[i])
            define_property_hook(fetch_, names[i], desc);
        }
        return fetch_
    }()
§
Posted: 12-04-2024

刪除,或改2,目前都一樣會卡
我暫時用ub擋
辛苦了

§
Posted: 13-04-2024
Edited: 13-04-2024

(另外多重測試後,發覺攔截腳本 1.1.6 版本不會停止,1.1.7 以後才會無法讀取緩衝)

所以是只有 youtube-js-engine-tamer 跟 攔截腳本 兩個開啟嗎

1.1.6 版本不會停止,1.1.7 和最新版本會停止?

§
Posted: 13-04-2024

刪除,或改 2,目前都一樣會卡

把以下的都刪掉看看

    unsafeWindow.Request = function () {
        let req = new origin_Request(...arguments)
        if (arguments.length > 1 && arguments[1]['body']) {
            req['body_'] = arguments[1]['body']
        }
        return req
    }

    let tmp_handle = function () {
        const xhr = this;
        inject_info.xhr = true
        const xhr_response_getter = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "response").get;
        const xhr_rsponse_hander = {
            get: () => {
                let result = xhr_response_getter.call(xhr);
                if (xhr.readyState === XMLHttpRequest.DONE) {
                    if (xhr.responseURL.indexOf('youtubei/v1/player') > -1) {
                        result = data_process.text_process(result, ytInitialPlayerResponse_ad_rule, 'insert', true)
                    }
                    if (xhr.responseURL.indexOf('youtube.com/playlist') > -1) {
                        let obj
                        try {
                            obj = JSON.parse(result)
                        } catch (error) {
                            log('JSON解析失败', 1);
                            return result
                        }
                        data_process.obj_process(obj[2].playerResponse, ytInitialPlayerResponse_ad_rule, true)
                        data_process.obj_process(obj[3].response, watch_page_ytInitialData_ad_rule, true)
                        tmp_debugger_value = obj
                        result = JSON.stringify(obj)
                    }
                } else {
                    result = ''
                }
                return result
            },
            configurable: true
        }
        define_property_hook(xhr, "responseText", xhr_rsponse_hander);
        define_property_hook(xhr, "response", xhr_rsponse_hander);
        XMLHttpRequest.prototype.open__.apply(this, arguments);
    }
    native_method_hook('XMLHttpRequest.prototype.open', tmp_handle)

§
Posted: 13-04-2024
Edited: 13-04-2024

抱歉忘記測試chrome,chrome和cent都沒辦法
我後面再重開機測試看看
不好修就算了沒事..頂多把分頁拉出來就不會在背景了,不常碰到這種使用情況
真是勞煩你檢查了~"~

§
Posted: 13-04-2024

(另外多重測試後,發覺攔截腳本 1.1.6 版本不會停止,1.1.7 以後才會無法讀取緩衝)

所以是只有 youtube-js-engine-tamer 跟 攔截腳本 兩個開啟嗎

是的,擴充都關閉了

1.1.6 版本不會停止,1.1.7 和最新版本會停止?

沒錯

§
Posted: 13-04-2024
Edited: 13-04-2024

https://github.com/cyfung1031/userscript-supports/raw/main/tmp-480192.user.js

你換這個試試看

把裡面的

const HACK_ytInitialPlayerResponse = true;
const HACK_ytInitialData = true;
const HACK_userAgent = true;
const HACK_createElement = true;
const HACK_fetch = true;
const HACK_Request = true;
const HACK_XHR = true;

true改成false; 試試找出是哪一個有衝突

(也有可能全部false都會有衝突)

§
Posted: 13-04-2024
Edited: 13-04-2024

HACK_Request = true;
從這個開始,48秒短片https://www.youtube.com/watch?v=XgZv_OpnZGo
緩衝有多讀取,但大部分卡最後一小段

但是這個還是一樣卡第一段,都大約30秒https://www.youtube.com/watch?v=0aIzfekltOM
【歌ってみた】ギフト / 内緒のピアス cover by TanZ

後來全部false,基本同樣情況...
測試前都會ctrl+shift+R以及ctrl+F5測試

§
Posted: 13-04-2024

所以只要把 HACK_Request = true; 改成 HACK_Request = false; 兩邊都能打開沒問題?

§
Posted: 13-04-2024
Edited: 13-04-2024

HACK_Request = false;
是,打開都沒問題

§
Posted: 13-04-2024

你試試

HACK_Request = true;

FIX_XHR_REQUESTING = false;

看看是不是也沒有問題

§
Posted: 13-04-2024

HACK_Request = false;是,打開都沒問題

如果 HACK_Request = true; 會出現什麼? 不是只有 " 緩衝有多讀取,但大部分卡最後一小段 " 這個問題嗎?應該四個都是成功吧

§
Posted: 14-04-2024

嘗試修正了 HACK_Request 相關的部份,你再安裝一次看看

https://github.com/cyfung1031/userscript-supports/raw/main/tmp-480192.user.js

§
Posted: 14-04-2024

剛下班不好意思
https://www.youtube.com/watch?v=0aIzfekltOM
【歌ってみた】ギフト / 内緒のピアス cover by TanZ
對這個來說HACK_Request = true;或false
或改FIX_XHR_REQUESTING = false;
都是一樣卡第一段緩衝

§
Posted: 14-04-2024
Edited: 14-04-2024

嘗試修正了 HACK_Request 相關的部份,你再安裝一次看看

https://github.com/cyfung1031/userscript-supports/raw/main/tmp-480192.user.js

腳本自動更新了~
仍然卡第一段緩衝...
-------------
剛安裝了[停用 YouTube AV1 和 VP9],竟然就正常了!!!
https://greasyfork.org/zh-TW/scripts/466132-disable-youtube-av1-and-vp9

§
Posted: 14-04-2024

const HACK_ytInitialPlayerResponse = true;
const HACK_ytInitialData = true;
const HACK_userAgent = true;
const HACK_createElement = true;
const HACK_fetch = true;
const HACK_Request = true;
const HACK_XHR = true;

所以這部份怎麼改也是 卡第一段緩衝 ?

§
Posted: 14-04-2024

是阿...不管哪一個false都是這樣...

§
Posted: 14-04-2024

https://photos.app.goo.gl/cd2d7SHDwmUn2ip96
嘗試錄製現場,不過如果分享系統音訊,似乎就會因為要讀取聲音,所以影片不會卡住...
所以測試影片就沒抓聲音...中間等待30秒可以跳過

§
Posted: 14-04-2024

喔..純粹就是播放到緩衝尾巴,然後影片卡住,標籤頁的喇叭會消失,這時候要切換過去,就會繼續讀取緩衝

§
Posted: 14-04-2024

確認可以重現,在0:20那個地方卡住了

問題解析中

§
Posted: 14-04-2024

修好了 你確認一下

§
Posted: 14-04-2024

確認可以正常播放了!
感謝~
chrome和cent都順利!

§
Posted: 23-04-2024

最近更新嘗試解決長久以來 空白鍵 不能有效暫停影片的問題

  1. 更新有機會影響快捷鍵
  2. 和其他腳本的快捷鍵或許有衝突

有問題請報告

§
Posted: 23-04-2024

基本上只要焦點不在聊天室,空白鍵都可以成功,滑鼠點了焦點就會固定在那邊。
資訊欄位內也不影響空白鍵,目前有沒有開腳本都差不多
live_chat的框架真的是另外一個世界呢~~

有碰到其他原因導致時會再回報,辛苦了

§
Posted: 26-04-2024

偶然測試到
YouTube JS Engine Tamer開著時
如果同時開
YouTube EXPERIMENT_FLAGS Tamer
空白鍵就無法執行(沒開tabview原本是會網頁下跳,有開tab則是不能執行影片暫停播放)
不過我現在比較不太用FLAGS Tamer了,想說有關空白鍵回報下
-----------------------
JS Engine Tamer最新版0.14.2
和tabview同時開會有高機率出現TAB表單停留在剛載入的小框,無法放大
(ctrl+r或F5才會出現,如果ctrl+F5或ctrl+shift+r則正常載入)
應該只是CSS衝突,因為Live Borderless有開就能正常放大,剛好停用所有樣式才發現

§
Posted: 27-04-2024
Edited: 27-04-2024

感謝回報

YouTube EXPERIMENT_FLAGS Tamer

  • 空白鍵就無法執行(沒開 tabview 原本是會網頁下跳,有開 tab 則是不能執行影片暫停播放)

    • 現在查明了原因。裡面多了一個SPACEBAR_CONTROL的設定。原先的是0,現在是1. 正常的話是2
    • 2的話可以按住空白快轉

JS Engine Tamer

  • 和 tabview 同時開會有高機率出現 TAB 表單停留在剛載入的小框,無法放大
    • 是的,這個問題也處理了
§
Posted: 27-04-2024

另外最近做了這個

有興趣可以試試 https://greasyfork.org/scripts/493607-youtube-fadeinchatmessage

§
Posted: 27-04-2024
Edited: 27-04-2024

辛苦了
YT現在原來多了空白長按2X~
滑鼠長按也2X了,有看到有人寫腳本阻止滑鼠2X
fadeinchatmessage感覺視覺效果,好像是聊天室文字瞬間閃一下
原來裡面可以改淡入ms

§
Posted: 03-05-2024

不過我現在比較不太用FLAGS Tamer了,想說有關空白鍵回報下

最近發現開了 FLAGS Tamer 真的會較順

現在我在試以下組合。有興趣可以試一下

  1. YouTubeVideo&music&kidsAdBlocking
  2. YouTube EXPERIMENT_FLAGS Tamer
  3. YouTube: Stable Streaming

這樣的話應該不會有廣告問題

§
Posted: 03-05-2024

之前單開1.,有時首頁廣告會偶爾顯示佔位就會多開
Remove Ads Slots in YouTube Main Page
不過最近1.新版似乎沒有這問題了

3.原本有裝,不過不清楚差在哪裡,看介紹寫測試,就沒問了

組合來測試看看,1.的看起來是您的修改版,我安裝一下

Post reply

Sign in to post a reply.