Skip to main content

Unofficial wrapper for mildom api.

Project description

Downloads Downloads Downloads

これは何?

Python用Mildom APIの非公式ライブラリです。 開発途中です。
バグがあればGithubのissueをお願いします。
This is an unofficial api wrapper for Mildom. If you find any bugs, please report it on issues by English or Japanese.

対応状況

  • ProfileV2 API
  • PlayBack API (配信アーカイブ)
    • アーカイブの範囲取得
  • EnterStudio API (ライブ配信)

対応予定

  • async/await(非同期処理)

注意 - notice-

あくまでも非公式APIの非公式ラッパーです。開発が継続される保証はありません。
This is unofficial wrapper. There is no guarantee of continuous development.
開発者は募集中です。
※バージョン2.0には破壊的変更を含む予定です。

使い方 -how to use-

  • 下の例に沿って各種オブジェクトを生成して使用する。
    Use as the instruction below.
  • mildom.api_request から各種API1のレスポンスをJSON(dict)で受け取る。
    Use mildom.api_request to get API response as json(dict).

Userオブジェクト -ProfileV2 API-

情報を更新する時は、User.updateで情報を更新できます。
You can refresh the data with User.update.

import mildom
user_id = 12345678

# 8桁のIDを指定してユーザーオブジェクトを作成
user = mildom.User(user_id)

Examples:

# bool値でライブ中かどうかを取得
print(user.is_live)

# プロフィールの画像URLを取得
print(user.avatar_url)

# レベルを取得
print(user.level)
  • ライブ中かどうかだけを取得 -get only if it's streaming or not-
import mildom
user_id = 12345678

if mildom.is_live(user_id):
    print('now on live')

PlayBack(アーカイブ)オブジェクト -PlayBack API-

  • 複数のアーカイブをリストで取得 -get multiple playbacks as a list-
import mildom
user_id = 12345678
user = mildom.User(user_id)

# "limit" argument is optional.
playback_list: list = user.fetch_playback(limit=10)
  • 特定のアーカイブを取得 -fetch specific PlayBack-
import mildom
user_id = 12345678
user = mildom.User(user_id)

# index starts from 0.
playback = user.fetch_playback(index=10)

Examples:

# URLを取得
print(playback.url)
# タイトルを取得
print(playback.title)
# MP4のURLを取得
print(playback.source_url)

注意 -notice-

「最新から2番目のアーカイブを取得したい」といった場合にはindexを指定してください。
使用しているAPIが異なるため、レスポンスを高速化できます。
以下は指定範囲のアーカイブをランダムに取得するテストにおけるレスポンス時間の平均値です。

0~425
index api time: 0.045539161014556885
----------------------------------------------
legacy api time: 0.06734103298187255


200~425
index api time: 0.049199145197868346
----------------------------------------------
legacy api time: 0.08169150960445404

300~425
index api time: 0.049523269319534304
----------------------------------------------
legacy api time: 0.10116533222198486

LiveStream(ライブ配信)オブジェクト -EnterStudio API-

import mildom
live_stream = mildom.LiveStream(user_id)

# 配信状況を取得
print(live_stream.is_live)
# タイトルを取得
print(live_stream.title)
# m3u8形式でストリーミングのURLを取得(VLCなどで再生可能)
if live_stream.is_dvr_enabled:
    # 配信者がDVRを有効にしていないと取得不可
    video_stream_links = live_stream.dvr_videos

Search API

category引数に指定できるstr一覧
List of str that can be used as the category argument.
["user", "live_stream", "video", "playback", "recommended_live_stream", "clip_video"]

import mildom
search_result: mildom.SearchResult = mildom.search("query")
search_result_with_category_specified = mildom.search("query", category="user")

SearchResultオブジェクトの値一覧
List of variables of SearchResult object.

SearchResult.clip_videos: list
SearchResult.live_streams: list
SearchResult.recommended_live_streams: list
SearchResult.videos: list
SearchResult.users: list
SearchResult.playbacks: list

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

mildom-1.4.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mildom-1.4.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file mildom-1.4.3.tar.gz.

File metadata

  • Download URL: mildom-1.4.3.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for mildom-1.4.3.tar.gz
Algorithm Hash digest
SHA256 6293fa18a72ca544db60a2ad776cf510f02c516634ee45d8686df46648478b57
MD5 9a927d4d44c5a8d60054faa69f3bffe3
BLAKE2b-256 9e63a820d94a41d2241057a8e00b081fb7440c23f3bbdbf832367405db7ccdec

See more details on using hashes here.

File details

Details for the file mildom-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: mildom-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for mildom-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef43a00991009d2d871c59076fef9259f71cc1fb17a025e649e7b355a9775153
MD5 c2ab1ae7ae697d68bc9d194c3cd754a7
BLAKE2b-256 56183a6cfa03d50a63e084e23257488f59b3d7b821e02f63939cadb9fa52f3f3

See more details on using hashes here.

Supported by

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