demon071 / Tiktok-API-Python

TIKTOK API IN PYTHON , GET TRENDING VIDEO, GET VIDEO BY CHALLENGE, GET VIDEO BY MUSIC, GET VIDEO BY USER, DOWNLOAD VIDEO NO WATERMARK
https://rapidapi.com/AdKT36/api/video-nwm
MIT License
129 stars 32 forks source link

Message: javascript error: a is not defined #28

Closed xuchangyuan closed 1 year ago

xuchangyuan commented 2 years ago

Hello, I downloaded your code and ran it today. I encountered problems in the process of running. It was normal to get the data on the first page, but I reported an error when I got the data on the second page.The following is the log I am running.

(tiktok39) PS C:\Users\xcy\Downloads\tiktok\Tiktok-API-Python> python .\getUserFeed.py

====== WebDriver manager ====== Current google-chrome version is 103.0.5060 Get LATEST chromedriver version for 103.0.5060 google-chrome Driver [C:\Users\xcy.wdm\drivers\chromedriver\win32\103.0.5060.53\chromedriver.exe] found in cache

DevTools listening on ws://127.0.0.1:53245/devtools/browser/53a7d838-24c1-497a-afe4-435bf709ca96 [7728:6808:0716/114037.381:ERROR:device_event_log_impl.cc(214)] [11:40:37.381] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed. [4468:3220:0716/114046.588:ERROR:gl_utils.cc(319)] [.WebGL-0000065A00398D00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels [2540:1100:0716/114046.696:ERROR:ssl_client_socket_impl.cc(996)] handshake failed; returned -1, SSL error code 1, net_error -101 [2540:1100:0716/114046.806:ERROR:ssl_client_socket_impl.cc(996)] handshake failed; returned -1, SSL error code 1, net_error -101 [2540:1100:0716/114048.245:ERROR:ssl_client_socket_impl.cc(996)] handshake failed; returned -1, SSL error code 1, net_error -101 Video <<7111016440416816430>> <<its the click click for me #HappyFathersDay>> Video <<7111102531161312558>> <<words of wisdom from @Rae Sremmurd @Swae Lee @Slim Jxmmi ✨ #SomethingInTheWater>> Video <<7111154066201333034>> <<ok but like why are @chloe x halle’s TikTok feed the same as mine? ☕️ #SomethingInTheWater>> Video <<7111389999735655723>> <<I like you @Post Malone @Doja Cat, i do 🫶 #somethinginthewater>> Video <<7111763250424941866>> <<#PrideMonth is about celebraring our captivating, fearless and authentic selves 🏳️‍🌈❤️🏳️‍⚧️ #ForYourPride>> Video <<7111799051363863850>> <<@GIVĒON with the TikTok delivery 💌 Track #15 Unholy Matrimony #BlackMusic>> Video <<7112192663679503658>> <<the beautiful words of @Eureka O’hara are all i need in my feed 💗 #ForYourPride>> Video <<7112528574325837099>> <<if you got 5 or more questions right, you are verified pride professional! 🙌🏆 #ForYourPride>> Video <<7113334680421813546>> <<looks like #Horace had a great time at #TikTokVidCon 🕺🏻>> Video <<7113746866751245611>> <<guess who came to the TikTok Creator Atrium at #TikTokVidCon? congrats to the king @khaby.lame 👑>> Video <<7114000052686949678>> <> Video <<7114389413366402346>> <<give your younger self a hug 🤗 #ForYourPride>> Video <<7114419476405243178>> <<aww they love me, they really love me 💖 #BETAwards #culturesbiggestnight>> Video <<7114767797812464939>> <<14-year-old Megan is proud of the incredible, authentic woman she became ❤️ #ForYourPride>> Video <<7114810000027012398>> <<Caught up with a couple creators at #TikTokVidCon ✨ totally agree that 😭 CRYING 😭 is a slay.>> Video <<7115137119445699883>> <<she spreads ✨joy✨on TikTok with her #RainbowBrightUnderEye 🌈 now get to know Originator @☆ naezrah #Originators>> Video <<7115446230448262446>> <<brb checking out my fave creators’ fave creators 👀#TikTokTrailblazers #ForYourPride>> Video <<7115527680971279659>> <<You’ll never know who you’ll see on the streets of @VidCon 👀 #TikTokVidCon>> Video <<7116948637745450286>> <<In this house, we ✨ create ✨ #TikTokVidCon>> Video <<7117323692941626666>> <<other cultures are here for THE culture and we love to see it. #BlackTikTok #BlackMusic @Black TikTok>> Video <<7117393879846128942>> <<living for the unhinged chaos on the red carpet of the TikTok creator party at #TikTokVidCon 🥳✨>> Video <<7117750537176649006>> <<who has better hair? @Chris Hemsworth or TikTok?? #ThorLoveAndThunder>> Video <<7117809702267850026>> <<Replying to @johnrinker took a sec for even @chrishemsworth to realize 😂 #thorloveandthunder>> Video <<7118065036903370026>> <<@soy ✨ with a little food for thought #Inspiration #FoodTok #TikTokVidCon>> Video <<7118122340046703915>> <<sounds like Thor needs to practice some self-care 🥰 #thorloveandthu nder>> Video <<7119208189517778219>> <<give @Hina a mic and let them slay the day away 🎤 #TikTokVidCon>> Video <<7119217765298326830>> <<have you checked out Money Heist: Korea on @Netflix? 💰 no spoilers please! 🙈>> Video <<7119563361938836782>> <<don’t wait for Arab American Heritage Month to discover incredible Arab American creators 🎤💅🎨 #DiversifyYourFYP>> Video <<7119937676341726510>> <<don’t be sad that u missed #EssenceFest2022, be happy that i made u this private tour 🤳 #EssenceFest>> Video <<7120348773460790574>> <<my soul might be broken but it's fine @beyonce #RENAISSANCE #Horace @jqgray>> code by t.me/toolav Traceback (most recent call last): File "C:\Users\xcy\Downloads\tiktok\Tiktok-API-Python\TiktokApi\api.py", line 57, in getUserFeed data = self.browser.fetch_browser(api_url, tt_params) File "C:\Users\xcy\Downloads\tiktok\Tiktok-API-Python\TiktokApi\browser.py", line 70, in fetch_browser return self.driver.execute_script("return a;") File "C:\Users\xcy.conda\envs\tiktok39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 884, in execute_script return self.execute(command, { File "C:\Users\xcy.conda\envs\tiktok39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 430, in execute self.error_handler.check_response(response) File "C:\Users\xcy.conda\envs\tiktok39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: a is not defined (Session info: chrome=103.0.5060.114) Stacktrace: Backtrace: Ordinal0 [0x01076463+2188387] Ordinal0 [0x0100E461+1762401] Ordinal0 [0x00F23D78+802168] Ordinal0 [0x00F26754+812884] Ordinal0 [0x00F26612+812562] Ordinal0 [0x00F26F8A+814986] Ordinal0 [0x00F7D669+1169001] Ordinal0 [0x00F6C7DC+1099740] Ordinal0 [0x00F7CC22+1166370] Ordinal0 [0x00F6C5F6+1099254] Ordinal0 [0x00F46BE0+945120] Ordinal0 [0x00F47AD6+948950] GetHandleVerifier [0x013171F2+2712546] GetHandleVerifier [0x0130886D+2652765] GetHandleVerifier [0x0110002A+520730] GetHandleVerifier [0x010FEE06+516086] Ordinal0 [0x0101468B+1787531] Ordinal0 [0x01018E88+1805960] Ordinal0 [0x01018F75+1806197] Ordinal0 [0x01021DF1+1842673] BaseThreadInitThunk [0x762F6359+25] RtlGetAppContainerNamedObjectPath [0x77227B74+228] RtlGetAppContainerNamedObjectPath [0x77227B44+180]

False Traceback (most recent call last): File "C:\Users\xcy\Downloads\tiktok\Tiktok-API-Python\getUserFeed.py", line 42, in for x in data['itemList']: TypeError: 'bool' object is not subscriptable

demon071 commented 2 years ago

I have updated the parameters, you can try again