Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request loadAsBlob add time limit (sometimes imagetwist.com wait return response blob without time limit) #81

Open
DandyClubs opened this issue Sep 7, 2023 · 0 comments

Comments

@DandyClubs
Copy link

DandyClubs commented Sep 7, 2023

i test get loadAsBlob imagetwist.com image

sometimes imagetwist.com return some links blob
some links wait response without time limit

I try

try {
                const extractor = urlExtractor.getExtractorByHost(imageHost)
                //console.log(extractor,imageURL, extractor.viewMode)

                if (extractor.viewMode === 'origin-download') {
                    imageURL = await image.CheckOnline(imageURL)
                    //imageURL = await image.loadAsBlob(imageURL)
                }
            } catch {
                console.log(imageURL)
                image.markAsBroken(link)
                link.setAttribute('target', '_blank')
            }
CheckOnline(url) {
            return new Promise((resolve, reject) => {
                let timer = setTimeout(() => resolve(url), 5000);
                GM_xmlhttpRequest({
                    method: "GET",
                    url: url,
                    headers: { referer: url, origin: url },
                    responseType: 'blob',
                    onload: function(resp) {
                        resolve(window.URL.createObjectURL(resp.response))
                    },
                    onerror: function(error) {
                        reject(error);
                    }
                })
            })
        },

after 2hour

i test

imagetwist.com return all links blob

request loadAsBlob add time limit

@DandyClubs DandyClubs changed the title imagetwist.com no return blob request loadAsBlob add time limit (sometimes imagetwist.com unlimited wait return response blob ) Sep 7, 2023
@DandyClubs DandyClubs changed the title request loadAsBlob add time limit (sometimes imagetwist.com unlimited wait return response blob ) request loadAsBlob add time limit (sometimes imagetwist.com wait return response blob without time limit) Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant