Table of Contents

Class Media

Namespace
Twikit
Assembly
Twikit.dll

メディアオブジェクトの基底クラス。

public class Media
Inheritance
Media
Derived
Inherited Members

Constructors

Media(IRequestClient, JsonObject)

public Media(IRequestClient client, JsonObject data)

Parameters

client IRequestClient
data JsonObject

Fields

ClientRef

protected readonly IRequestClient ClientRef

Field Value

IRequestClient

Properties

Data

X から受け取った生の JSON。

public JsonObject Data { get; }

Property Value

JsonObject

DisplayUrl

表示用 URL。

public string? DisplayUrl { get; }

Property Value

string

ExpandedUrl

展開済みの表示 URL。

public string? ExpandedUrl { get; }

Property Value

string

FocusRects

public JsonArray? FocusRects { get; }

Property Value

JsonArray

Height

高さ。

public int? Height { get; }

Property Value

int?

Id

メディア ID。

public string? Id { get; }

Property Value

string

MediaUrl

メディアの URL。

public string? MediaUrl { get; }

Property Value

string

OriginalInfo

public JsonObject? OriginalInfo { get; }

Property Value

JsonObject

Sizes

各サイズの情報。

public JsonObject? Sizes { get; }

Property Value

JsonObject

SourceStatusId

元のツイートの ID。

public string? SourceStatusId { get; }

Property Value

string

SourceUrl

元の(フル解像度の)メディア URL。

public string? SourceUrl { get; }

Property Value

string

SourceUserId

元のツイートを投稿したユーザーの ID。

public string? SourceUserId { get; }

Property Value

string

Type

メディアの種類(photo / video / animated_gif)。

public string? Type { get; }

Property Value

string

Url

t.co の URL。

public string? Url { get; }

Property Value

string

Width

幅。

public int? Width { get; }

Property Value

int?

Methods

DownloadAsync(string)

メディアをファイルに保存します。

public Task DownloadAsync(string outputPath)

Parameters

outputPath string

Returns

Task

FromData(IRequestClient, JsonObject)

メディア JSON から適切なクラスのインスタンスを作ります。未知の種類は警告を出して null。

public static Media? FromData(IRequestClient client, JsonObject data)

Parameters

client IRequestClient
data JsonObject

Returns

Media

GetAsync()

メディアの内容を取得します。

public Task<byte[]> GetAsync()

Returns

Task<byte[]>

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.