n0l3r / tiktok-downloader

tiktok downloader is a tool to download video from tiktok with watermark or without watermark. There are two features that is, mass download (by username/urls) and single download (by url).
MIT License
327 stars 130 forks source link

0 video found, and more 0's after captcha #25

Open sdbrown67 opened 1 year ago

sdbrown67 commented 1 year ago

Seems to not be working now, has tiktok changed something on their page structure?

sdbrown67 commented 1 year ago

Figured it out the wrapper name has changed.... Line 144: const listVideo = Array.from(document.querySelectorAll(".tiktok-1s72ajp-DivWrapper > a"));

Fixed it.

duchieu235 commented 1 year ago

i did this, videos are now found but im getting |Error: URL not found|

Keytoll commented 1 year ago

i did this, videos are now found but im getting |Error: URL not found|

hello, see if Line 145: return listVideo.map(item => item.getAttribute('href')); fixes it for you.

duchieu235 commented 1 year ago

i did this, videos are now found but im getting |Error: URL not found|

hello, see if Line 145: return listVideo.map(item => item.getAttribute('href')); fixes it for you.

no that didnt do it

matthewcoolio commented 1 year ago

So that does work, no need to change the line 145, but do change the Line 144 to as @sdbrown67 suggested :

const listVideo = Array.from(document.querySelectorAll(".tiktok-1s72ajp-DivWrapper > a"));

but you need to change a few more lines of code. i'll show an example, please see this as a very temporary fix to the issue as it could bug out if there was an issue with a non matching url.

Lines 176-177 inside of the

if (!matching){
        const idVideo = url.substring(url.indexOf("/video/") + 7, url.length);
        return (idVideo.length > 19) ? idVideo.substring(0, idVideo.indexOf("?")) : idVideo;
}

If you change it to this it'll bypass the no url error.

RazeBerry commented 1 year ago

I have fixed line 144 as suggested by @sdbrown67 and also line 176 @matthewcoolio but it still has the error "[] 0 video found [X] No more video found [] Total video found: 0 [!] Error: No video found" In addition, as soon as the browser opens, it is there for half a second, then it disappears. I thought this is supposed to be headless?

matthewcoolio commented 1 year ago

https://github.com/BrandonS8/tiktok-downloader

This one is now fully working

RazeBerry commented 1 year ago

@matthewcoolio Your repo also has some unforeseen problem on my machine. ` /Users/sihao/Insta/tiktok-downloader/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221 throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails)); ^

Error: Evaluation failed: TypeError: Cannot read properties of null (reading 'innerHTML') at puppeteer_evaluation_script:3:44 at ExecutionContext._evaluateInternal (/Users/sihao/Insta/tiktok-downloader/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:221:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async ExecutionContext.evaluate (/Users/sihao/Insta/tiktok-downloader/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:16) at async getListVideoByUsername (/Users/sihao/Insta/tiktok-downloader/index.js:159:17) at async /Users/sihao/Insta/tiktok-downloader/index.js:223:17

Node.js v18.16.0

`

Danhhoa commented 1 year ago

https://github.com/BrandonS8/tiktok-downloader

This one is now fully working

Hi @matthewcoolio, seems feature scrape from username just found 30 videos and not more because captcha of instagram, are you have solutions for this problem?

nullptrmachine commented 1 year ago
        listVideo = await page.evaluate(() => {
            var pageJSON = document.querySelector('#SIGI_STATE')
            var parsedJSON = JSON.parse(pageJSON.innerHTML)
            const listVideo = parsedJSON.ItemList['user-post'].list
            return listVideo.map(function (i) { return window.location.href + '/video/' + i })
        })

this works but it only goes to 35 and I dunno why

ab22070 commented 12 months ago

https://github.com/BrandonS8/tiktok-downloader This one is now fully working

Hi @matthewcoolio, seems feature scrape from username just found 30 videos and not more because captcha of instagram, are you have solutions for this problem?

Did you manage to find a fix?