karim0sec / Bulk-Tiktoks-Downloader

Simple Script to bulk download TikTok clips without a watermark, used node js and puppeteer headless browser to titles + append #shorts and save videos
MIT License
80 stars 32 forks source link

Download Videos From A Single User #2

Closed dori921 closed 2 years ago

dori921 commented 2 years ago

Hey, can u make it download the videos from a specific user ? Thanks

dori921 commented 2 years ago

Any update ?

karim0sec commented 2 years ago

Sorry, I was busy, yeah Updated even after TikTok new implemented bot detection captcha it stops the script at the first page but gladly after it gets URLs, change @willsmith to user-id and it will work like charm

dori921 commented 2 years ago

thank you

Reamasa commented 2 years ago

Sorry, I was busy, yeah Updated even after TikTok new implemented bot detection captcha it stops the script at the first page but gladly after it gets URLs, change @Willsmith to user-id and it will work like charm

Hi! After change to user-id it still download another videos that not video from our user that we specific. If I want to download videos from a user profile only is it can or not?

karim0sec commented 2 years ago

if you visit a profile it only shows videos and views without a description that's why I kept it get user videos from search results with a description maybe not so accurate result

if u want only videos of that user without description u can change

https://www.tiktok.com/@willsmith instead of https://www.tiktok.com/search/video?q=@willsmith

and

div.jsx-1906445185.video-feed.compact > div > div > div > div > a

instead of

div.tiktok-bbkab3-DivContainer > div > div > a

and delete

  for (var i=0;i<2;i++){ //Loop 2 pages
  await page.waitForSelector('button[data-e2e=search-load-more]');
  await page.keyboard.press('PageDown');
  await page.waitForTimeout('300');
  await page.keyboard.press('PageDown');
  await page.waitForTimeout('300');
  await page.keyboard.press('PageDown');
  await page.waitForTimeout('300');
  await page.keyboard.press('PageDown');
  await page.click('button[data-e2e=search-load-more]')
  }
Reamasa commented 2 years ago

without a description

That work. Thank.

Reamasa commented 2 years ago

if you visit a profile it only shows videos and views without a description that's why I kept it get user videos from search results with a description maybe not so accurate result

if u want only videos of that user without description u can change

https://www.tiktok.com/@willsmith instead of https://www.tiktok.com/search/video?q=@willsmith

and

div.jsx-1906445185.video-feed.compact > div > div > div > div > a

instead of

div.tiktok-bbkab3-DivContainer > div > div > a

and delete

  for (var i=0;i<2;i++){ //Loop 2 pages
  await page.waitForSelector('button[data-e2e=search-load-more]');
  await page.keyboard.press('PageDown');
  await page.waitForTimeout('300');
  await page.keyboard.press('PageDown');
  await page.waitForTimeout('300');
  await page.keyboard.press('PageDown');
  await page.waitForTimeout('300');
  await page.keyboard.press('PageDown');
  await page.click('button[data-e2e=search-load-more]')
  }

Hi! I have encountered​ another issues. When I do that I can download only 6 videos from a profile. What wrong in the script? Thanks for your time.

karim0sec commented 2 years ago

I write a new script to download all videos of a single profile but it requires plugins to avoid bot detection of TikTok on this link

https://github.com/Karim-Arab/Tiktok2Youtube-shorts/blob/main/allvideosuser.js

in project location in cmd or terminal :

after editing the profile URL, now use:

node allvideosuser

Goodluck :)

Reamasa commented 2 years ago

I write a new script to download all videos of a single profile but it requires plugins to avoid bot detection of TikTok on this link

https://github.com/Karim-Arab/Tiktok2Youtube-shorts/blob/main/allvideosuser.js

in project location in cmd or terminal :

  • npm install puppeteer puppeteer-extra
  • npm install puppeteer-extra-plugin-stealth puppeteer-extra-plugin-adblocker

after editing the profile URL, now use:

node allvideosuser

Goodluck :)

Thanks for your time.

Reamasa commented 2 years ago

I write a new script to download all videos of a single profile but it requires plugins to avoid bot detection of TikTok on this link

https://github.com/Karim-Arab/Tiktok2Youtube-shorts/blob/main/allvideosuser.js

in project location in cmd or terminal :

  • npm install puppeteer puppeteer-extra
  • npm install puppeteer-extra-plugin-stealth puppeteer-extra-plugin-adblocker

after editing the profile URL, now use:

node allvideosuser

Goodluck :)

Hi! I have test your new allvideosuser.js I have download videos from a tiktok profile that have video maybe 138 But I get only 61 videos that have done for downloaded. What wrong? Thanks again.

This my output error message: Done c:\Users\XXXX\node_modules\puppeteer-core\lib\cjs\puppeteer\common\DOMWorld.js:517 const timeoutError = new Errors_js_1.TimeoutError(waiting for ${options.title} failed: timeout ${options.timeout}ms exceeded); ^

TimeoutError: waiting for XPath //*[@id="download-block"]/div/a[1] failed: timeout 30000ms exceeded at new WaitTask (c:\Users\XXXX\node_modules\puppeteer-core\lib\cjs\puppeteer\common\DOMWorld.js:517:34) at DOMWorld.waitForXPath (c:\Users\XXXX\node_modules\puppeteer-core\lib\cjs\puppeteer\common\DOMWorld.js:453:26) at Frame.waitForXPath (c:\Users\XXXX\node_modules\puppeteer-core\lib\cjs\puppeteer\common\FrameManager.js:948:51) at Page.waitForXPath (c:\Users\XXXX\node_modules\puppeteer-core\lib\cjs\puppeteer\common\Page.js:2410:33) at main (c:\Users\XXXX\allvideosuser.js:51:16) PS C:\Users\XXXX>

karim0sec commented 2 years ago

seems snaptik breaks I update the code with randomize waiting for values and slow it a bit, i can't test due to limited internet where I am it but I am sure it would work fine

Reamasa commented 2 years ago

seems snaptik breaks I update the code with randomize waiting for values and slow it a bit, i can't test due to limited internet where I am it but I am sure it would work fine

It work. Thanks.