Skip to main content

bilibili_up获取bilibili视频信息的爬虫!

Project description

Bilibili_up 使用方法


关于 BV 号视频的操作

导入BV操作
获取BV视频评论区(字典)
from bilibili_up import BV

#获取BV视频评论区(字典)
comments = BV_get_comments(BV=123456789, 
           PageNumber=5, 
           headers={"User-Agent": "Mozilla/5.0"})
for username, content in comments.items():
    print(f"{username}: {content}")

其中,BV、PageNumber是必选参数,其他为可选参数。
PageNumber:页数(1~PageNumber)
BV:视频BV号
headers(可选):自定义请求头
返回值是一个字典{username:content}

自定义ip选项下一个版本加上

获取视频信息

video_info = BV_get_File("BVxxxxxxxx", headers={"User-Agent": "Mozilla/5.0"})
print(video_info)

该函数会返回一个字典,包含视频的播放量、发布时间、作者信息和弹幕数量。
源代码的一部分:

return {
                "播放量": play_count,
                "发布时间": publish_time,
                "作者": {
                    "名称": author_name,
                    "UID": author_uid
                },
                "弹幕数量": danmaku_count
            }

想获得作者的uid就需要:

a = BV_get_File("BVxxxxxxxx")["作者"]["UID"]

其中,BV是必选参数,其他为可选参数。
BV:视频BV号
headers(可选):自定义请求头

在0.2.1.1版本中,获取BV视频评论区中的BV参数是video_bv(以过时)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilibili_up-0.2.1.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

bilibili_up-0.2.1.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file bilibili_up-0.2.1.3.tar.gz.

File metadata

  • Download URL: bilibili_up-0.2.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.6

File hashes

Hashes for bilibili_up-0.2.1.3.tar.gz
Algorithm Hash digest
SHA256 aae744e93779dda70db49f2d7af8c403b9c3123527c4d34c226ab942e929e74d
MD5 9f4ece011ce749a922ab13f69dc9645f
BLAKE2b-256 14245abbc2f5b69ed14c95b67a2be9e2b788a2ebbcaca530144d2cdd785a86f6

See more details on using hashes here.

File details

Details for the file bilibili_up-0.2.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bilibili_up-0.2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 37984d55b6531c5202638cf167eadf68bdeb7ba989ef4f2bc69887396306dcea
MD5 a51286370ab181ebb708231c29dc1adc
BLAKE2b-256 c09a3a6f140d6247a87ac51e61c14b619db0dfbf8b232055e763e55dd4e7b3ad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page