davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.91k stars 984 forks source link

browsermob-proxy, geckodriver and Firefox installation, setup and running #20

Closed pragmaticQt closed 5 years ago

pragmaticQt commented 5 years ago

Hi David,

Thank you for your fantastic work and could you please give an explanation about how to know if browsermob-proxy, geckodriver and Firefox run together successfully? any configuration or startup order requirements on them.

I followed the Installing instructions and was trying to run the example-getTrending.py first. But get errors:

C:\Users\Owner.virtualenvs\TikTok-GPkkHXDp\Scripts\python.exe C:/Users/Owner/PycharmProjects/TikTok/examples/getTrending.py New class reference, finding valid signature. This might take a minute. Traceback (most recent call last): File "C:/Users/Owner/PycharmProjects/TikTok/examples/getTrending.py", line 8, in trending = api.trending(results) File "C:\Users\Owner.virtualenvs\TikTok-GPkkHXDp\lib\site-packages\TikTokApi\tiktok.py", line 246, in trending self.signature AttributeError: 'TikTokapi' object has no attribute 'signature'

Process finished with exit code 1

I found logs of the above servers, looks like they didn't run successfully.

bmp.log

[INFO 2019-11-04T22:56:28,200 net.lightbody.bmp.proxy.Main] (main) Starting BrowserMob Proxy version 2.1.4 [INFO 2019-11-04T22:56:28,283 org.eclipse.jetty.util.log] (main) jetty-7.x.y-SNAPSHOT [INFO 2019-11-04T22:56:29,098 org.eclipse.jetty.util.log] (main) started o.e.j.s.ServletContextHandler{/,null} [INFO 2019-11-04T22:56:29,495 org.eclipse.jetty.util.log] (main) Started SelectChannelConnector@0.0.0.0:8090 [INFO 2019-11-04T22:56:33,616 org.littleshoot.proxy.impl.DefaultHttpProxyServer] (qtp1503660218-21) Starting proxy at address: 0.0.0.0/0.0.0.0:8091 [INFO 2019-11-04T22:56:33,688 org.littleshoot.proxy.impl.DefaultHttpProxyServer] (qtp1503660218-21) Proxy listening with TCP transport [INFO 2019-11-04T22:56:34,787 org.littleshoot.proxy.impl.DefaultHttpProxyServer] (qtp1503660218-21) Proxy started at address: /0:0:0:0:0:0:0:0:8091 [INFO 2019-11-04T22:56:53,795 org.littleshoot.proxy.impl.ClientToProxyConnection] (LittleProxy-0-ClientToProxyWorker-7) (AWAITING_INITIAL) [id: 0x0d4e71a9, L:/0:0:0:0:0:0:0:1:8091 - R:/0:0:0:0:0:0:0:1:57744]: An IOException occurred on ClientToProxyConnection: An established connection was aborted by the software in your host machine [INFO 2019-11-04T22:56:55,311 org.littleshoot.proxy.impl.ClientToProxyConnection] (LittleProxy-0-ClientToProxyWorker-0) (NEGOTIATING_CONNECT) [id: 0xcffd8c37, L:/0:0:0:0:0:0:0:1:8091 - R:/0:0:0:0:0:0:0:1:57746]: An IOException occurred on ClientToProxyConnection: An established connection was aborted by the software in your host machine [INFO 2019-11-04T22:56:55,323 org.littleshoot.proxy.impl.ProxyToServerConnection] (LittleProxy-0-ProxyToServerWorker-0) (DISCONNECTED) [id: 0x9418bdfc, L:0.0.0.0/0.0.0.0:57748]: Connection to upstream server failed java.nio.channels.ClosedChannelException: null at io.netty.handler.ssl.SslHandler.channelInactive(...)(Unknown Source) ~[browsermob-dist-2.1.4.jar:?]

server.log

Running BrowserMob Proxy using LittleProxy implementation. To revert to the legacy implementation, run the proxy with the command-line option '--use-littleproxy false'. [INFO 2019-11-04T22:56:28,200 net.lightbody.bmp.proxy.Main] (main) Starting BrowserMob Proxy version 2.1.4 [INFO 2019-11-04T22:56:28,283 org.eclipse.jetty.util.log] (main) jetty-7.x.y-SNAPSHOT [INFO 2019-11-04T22:56:29,098 org.eclipse.jetty.util.log] (main) started o.e.j.s.ServletContextHandler{/,null} [INFO 2019-11-04T22:56:29,495 org.eclipse.jetty.util.log] (main) Started SelectChannelConnector@0.0.0.0:8090 [INFO 2019-11-04T22:56:33,616 org.littleshoot.proxy.impl.DefaultHttpProxyServer] (qtp1503660218-21) Starting proxy at address: 0.0.0.0/0.0.0.0:8091 [INFO 2019-11-04T22:56:33,688 org.littleshoot.proxy.impl.DefaultHttpProxyServer] (qtp1503660218-21) Proxy listening with TCP transport [INFO 2019-11-04T22:56:34,787 org.littleshoot.proxy.impl.DefaultHttpProxyServer] (qtp1503660218-21) Proxy started at address: /0:0:0:0:0:0:0:0:8091 [INFO 2019-11-04T22:56:53,795 org.littleshoot.proxy.impl.ClientToProxyConnection] (LittleProxy-0-ClientToProxyWorker-7) (AWAITING_INITIAL) [id: 0x0d4e71a9, L:/0:0:0:0:0:0:0:1:8091 - R:/0:0:0:0:0:0:0:1:57744]: An IOException occurred on ClientToProxyConnection: An established connection was aborted by the software in your host machine [INFO 2019-11-04T22:56:55,311 org.littleshoot.proxy.impl.ClientToProxyConnection] (LittleProxy-0-ClientToProxyWorker-0) (NEGOTIATING_CONNECT) [id: 0xcffd8c37, L:/0:0:0:0:0:0:0:1:8091 - R:/0:0:0:0:0:0:0:1:57746]: An IOException occurred on ClientToProxyConnection: An established connection was aborted by the software in your host machine [INFO 2019-11-04T22:56:55,323 org.littleshoot.proxy.impl.ProxyToServerConnection] (LittleProxy-0-ProxyToServerWorker-0) (DISCONNECTED) [id: 0x9418bdfc, L:0.0.0.0/0.0.0.0:57748]: Connection to upstream server failed java.nio.channels.ClosedChannelException: null at io.netty.handler.ssl.SslHandler.channelInactive(...)(Unknown Source) ~[browsermob-dist-2.1.4.jar:?]

====== geckodriver.log

1572879398947 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe" "-marionette" "-foreground" "-no-remote" "-profile" "C:\Users\Owner\AppData\Local\Temp\rust_mozprofilewtK5Yc" 1572879402275 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons 1572879402276 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry 1572879402276 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/ 1572879402277 addons.webextension.screenshots@mozilla.org WARN Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader* JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory. 1572879408577 Marionette INFO Listening on port 57711 1572879408762 Marionette WARN TLS certificate errors will be ignored for this session 1572879413597 Marionette INFO Stopped listening on port 57711 [Child 10436, Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1572401533/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 341 [Child 10436, Chrome_ChildThread] [Child 8216, Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1572401533/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 341 console.error: (new Error("Transaction canceled due to a closed connection.", "resource://gre/modules/Sqlite.jsm", 613)) [GPU 10888, Chrome_ChildThread] WARNING: pipe error: 109: file z:/task_1572401533/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, li

!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

ne 341

!!! [Child][MessageChannel::SendAndWait] Error: Channel error: cannot send/recv

issue-label-bot[bot] commented 5 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

davidteather commented 5 years ago

Right now the api is broken sorry about that. Tiktok changed their website to make it much more difficult for unofficial apis.

I’ve been working on a solution but it’ll take time and might not even work.

davidteather commented 5 years ago

Closing for known issue see this issue