Comments (11)
You're trying to download an array of urls try
from TikTokApi import TikTokapi
# Starts The Api Class
api = TikTokapi("browsermob-proxy/bin/browsermob-proxy")
# The Number of trending TikToks you want to be displayed
results = 10
hashtag = ("meme")
result = api.search_by_hashtag(hashtag, results)
prevloops = 0
for tiktok in result :
# Prints the text of the tiktok
videoURL = tiktok["itemInfos"]["video"]["urls"][0]
videoname = "video" + str(prevloops) + ".mp4"
urllib.request.urlretrieve(videoURL, videoname)
prevloops += 1
from tiktok-api.
Issue-Label Bot is automatically applying the label question
to this issue, with a confidence of 0.92. Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
from tiktok-api.
Are you talking about [itemInfos][id]?
Currently there’s no ability to get that json by a url. I’ll implement that feature either today or over the weekend.
from tiktok-api.
can you please explain to me that how i get "video_id"(v12345679978912zxasd) ?
what should i have to call to get this file "ExTikTokResonse.json" response in php ?
from tiktok-api.
Since this is a python package you would have to create a python script that you could use the php exec command to execute the code and fetch the output of that program.
Here is example code of how to specify a search by hashtag and result number. Ex calling command
python TikTok-Api-CLI.py funny 10
Here is a link to the php exec command.
Another option is to use this python API to find the signature you need to make requests to their database, however that would still require integration to a python script.
A third option is that the python script finds the ExTikTokResponse.json and saves it to a file, then you load that file in php.
from tiktok-api.
If you want to download the video in python here's example code
from TikTokApi import TikTokapi
import urllib.request
# Starts T
api = TikTokapi("path/to/browsermob-proxy")
# The Number of trending TikToks you want to be displayed
results = 1
trending = api.trending(results)
for tiktok in trending:
# Prints the text of the tiktok
videoURL = tiktok["itemInfos"]["video"]["urls"][2]
urllib.request.urlretrieve(videoURL, 'video_name.mp4')
from tiktok-api.
sorry but i'm getting error of browsermob-proxy... i don't understand how to set that path. i already downloaded that.
from tiktok-api.
Download browsermob proxy and place it as such and change “path/to/browsermob-proxy” to be “browsermob-proxy”
If that doesn’t work try “browsermob-proxy/bin”
ProjectFolder
- main.py
- browsermob-proxy
- bin
Google adding to path on whatever your operating system is.
Then add ProjectFolder/browsermob-proxy/bin to the path.
from tiktok-api.
okay i will check it. thanks again.
from tiktok-api.
Updated main branch adding new release and pypi release in a few minutes.
from tiktok-api.
Trying to download hashtag videos with the api,
from TikTokApi import TikTokapi
# Starts The Api Class
api = TikTokapi("browsermob-proxy/bin/browsermob-proxy")
# The Number of trending TikToks you want to be displayed
results = 10
hashtag = ("meme")
result = api.search_by_hashtag(hashtag, results)
prevloops = 0
for tiktok in trending:
# Prints the text of the tiktok
videoURL = tiktok["itemInfos"]["video"]["urls"]
videoname = "video" + str(prevloops) + ".mp4"
urllib.request.urlretrieve(videoURL, videoname)
prevloops += 1
but unfortunately get this error
File ".\testest.py", line 20, in <module> urllib.request.urlretrieve(videoURL, 'videoname.mp4') File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 245, in urlretrieve url_type, path = splittype(url) File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\urllib\parse.py", line 940, in splittype match = _typeprog.match(url) TypeError: expected string or bytes-like object
Any advice on how to download videos based on hashtag?
Thank you very much ! @davidteather
from tiktok-api.
Related Issues (20)
- [FEATURE_REQUEST] - Multiple hashtags for api
- Getting more video ids than 30 fails HOT 10
- I got error " Failed to get msToken from cookies" HOT 2
- [BUG] - Empty userInfo for small accounts HOT 1
- Videos generated in the last 24 hours for a specific word
- Any function returns permanently empty fields HOT 6
- Is this repo available now?
- music have 40k videos but scrab only 4k videos HOT 3
- [FEATURE_REQUEST] - What you want here
- [INSTALLATION] - Change the region of content HOT 8
- [BUG] - Your Error Here HOT 1
- Issue with User HOT 2
- Legal Implications of Using TikTok Data for Insights as Per Its Terms of Service
- [FEATURE_REQUEST] - Regarding creating a session
- [BUG] - cannot import name 'TikTokApi' from 'TikTokApi'
- [QUESTION] - How to use proxies to get anothor region TikToks? HOT 4
- Not able to fetch more than 10 users for a particular keyword
- How to deploy TikTokApi script?
- Getting EmptyResponseException HOT 3
- Data from the past HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiktok-api.