douyin-api
说明
抖音官网接口
开发者文档:https://developer.open-douyin.com/docs-page
移动/网站应用文档指引:https://developer.open-douyin.com/docs/resource/zh-CN/dop/overview/usage-guide
接口演示
from douyin_api import DouYin
from douyin_api.utils import Timer
from douyin_api.tool import get_video_id_by_short_url, get_iframe_data_by_video_id
from _.不要对外公开 import client_key, client_secret, redirect_uri, access_token, open_id, item_id, refresh_token, short_url
正式环境 = 'https://open.douyin.com'
沙盒环境 = 'https://open-sandbox.douyin.com'
if __name__ == '__main__':
with Timer() as timer:
...
d = DouYin(client_key, client_secret, 正式环境)
# print(d.client_token())
scope = 'user_info,video.list.bind,video.data.bind'
scope += ',trial.whitelist' # 测试的时候需要这个权限
# renew_refresh_token 用户授权续期
print(d.get_permission_code_url(scope=scope, redirect_uri=redirect_uri))
# print(d.access_token(code='9c1592704acfd7dbuQbpWj9u7EsBV8KuDbPT'))
# 刷新 refresh_token 的有效期
# print(d.renew_refresh_token(refresh_token))
# 刷新 refresh_token 的有效期
# print(d.refresh_token(refresh_token))
# 设置用户access_token,有些接口需要这个才能访问
d.set_access_token(access_token, open_id)
# print(d.userinfo())
# 分页获取用户所有视频的数据,返回的数据是实时的
# print(d.video_list(cursor=0, count=10))
# 查看设置用户access_token是否影响client_token接口访问
# print(d.client_token())
# video_id = get_video_id_by_short_url(short_url)
# print('从抖音短连接获取视频id', video_id)
# # 通过VideoID获取IFrame代码
# if video_id:
# print(get_iframe_data_by_video_id(video_id))
# 查询用户特定视频的数据,如点赞数、播放数等,返回的数据是实时的
# print(d.video_data(ids=[item_id]))
# print(d.video_data(ids=[str(video_id)], use_item_ids=False))
Metadata
Release files for douyin-api 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| douyin-api-0.1.11.tar.gz | 12.7 kB | Without provenance | Details for douyin-api-0.1.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| douyin_api-0.1.11-py3-none-any.whl | Python 3 | none | any | Details for douyin_api-0.1.11-py3-none-any.whl |
Total release size: 25.6 kB
Release files / douyin-api-0.1.11.tar.gz
| Download URL | douyin-api-0.1.11.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbefc7147962cb64b51a2c424ac90631629b7bb7314548b09ba40c034995edd9
|
|
BLAKE2b-256 checksum How to use checksums |
25f36d3e03c8af94f53ead559d1851118c2a39fef00d06de054014b6fb92081e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.19 tqdm/4.49.0 importlib-metadata/4.8.1 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.6.8
|
Release files / douyin_api-0.1.11-py3-none-any.whl
| Download URL | douyin_api-0.1.11-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dfbabfb0cce133192c019ddba4e258cf2788cc70910c50e7898ca786b902cf1
|
|
BLAKE2b-256 checksum How to use checksums |
82489a92176a99bfd4f9c8013998eaeded37b4c1ade9246957e68c051ee51061
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.19 tqdm/4.49.0 importlib-metadata/4.8.1 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.3 CPython/3.6.8
|
Security for douyin-api 0.1.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.