BKVideo

public enum BKVideo
extension BKVideo: CustomStringConvertible
extension BKVideo: Equatable

Bilibili video, identified by unique bv string (bvid) or [deprecated] av number (aid).

Networking

  • Fetchs and passes this video’s info to handler.

    See more

    Declaration

    Swift

    public func getInfo(
        cid: Int? = nil,
        then handler: @escaping BKHandler<Info>
    )

    Parameters

    cid

    a specific page to process.

    handler

    code to process optional Info.

  • Dimension of the video

    See more

    Declaration

    Swift

    public struct Dimension : Codable
  • Sub page of video, identified by unique cid.

    See more

    Declaration

    Swift

    public struct Page : Codable, Equatable
  • Fetch all pages of video and perform action over.

    Declaration

    Swift

    public func pages(handler: @escaping BKHandler<[Page]>)

    Parameters

    handler

    code to perform on the pages.

  • Fetch the first page of video and perform action over.

    Declaration

    Swift

    public func p1(handler: @escaping BKHandler<Page>)

    Parameters

    handler

    code to perform on the page.

  • Fetch page of video at index and perform action over.

    Declaration

    Swift

    public func page(_ index: Int, handler: @escaping BKHandler<Page>)

    Parameters

    index

    ONE based index of the page to fetch.

    handler

    code to perform on the page.

  • Fetch page of video at index and perform action over.

    Declaration

    Swift

    public subscript(index: Int, handler: @escaping BKHandler<Page>) -> Void { get }

    Parameters

    index

    ZERO based index of the page to fetch.

    handler

    code to perform on the page.

  • Undocumented

    See more

    Declaration

    Swift

    public class _BaseStat : Codable
  • Undocumented

    See more

    Declaration

    Swift

    public final class ArchiveStat : _BaseStat
  • Undocumented

    See more

    Declaration

    Swift

    public final class InfoStat : _BaseStat
  • Undocumented

    Declaration

    Swift

    public func getStat(then handler: @escaping BKHandler<ArchiveStat>)
  • In case if local conversion fails, this fetches the real IDs.

    Declaration

    Swift

    public func getIDs(then handler: @escaping BKHandler<(aid: Int, bvid: String)>)

    Parameters

    handler

    process real aid and bvid

URL Params

Local conversion between AV and BV

  • aid

    The associated av number of this video.

    Note

    it’s highly likely that an overflow will happen eventually. In that case, we crash.

    Declaration

    Swift

    public var aid: Int { get }
  • The associated bv string of this video.

    Note

    it’s highly likely that an overflow will happen eventually. In that case, we crash.

    Declaration

    Swift

    public var bvid: String { get }
  • Converts the given bv ID string to its corresponding av number.

    Note

    it’s highly likely that an overflow will happen eventually. In that case, we crash.

    Declaration

    Swift

    public static func aid(fromBV bvid: String) -> Int

    Parameters

    bvid

    the bv ID string to convert from.

  • Converts the given av number to its corresponding bv ID string.

    Note

    it’s highly likely that an overflow will happen eventually. In that case, we crash.

    Declaration

    Swift

    public static func bvid(fromAV aid: Int) -> String

    Parameters

    aid

    the av number to convert from.

  • Returns a Boolean value indicating whether two values are equal. Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    public static func == (lhs: BKVideo, rhs: BKVideo) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.