389 lines
19 KiB
Go
389 lines
19 KiB
Go
package ytdlp
|
|
|
|
type Info struct {
|
|
ID string `json:"id"`
|
|
Title string `json:"title"`
|
|
Availability string `json:"availability"`
|
|
ChannelFollowerCount *int64 `json:"channel_follower_count"`
|
|
Description string `json:"description"`
|
|
Tags []string `json:"tags"`
|
|
Thumbnails []Thumbnail `json:"thumbnails"`
|
|
ModifiedDate *string `json:"modified_date,omitempty"`
|
|
ViewCount int64 `json:"view_count"`
|
|
PlaylistCount *int64 `json:"playlist_count,omitempty"`
|
|
Channel string `json:"channel"`
|
|
ChannelID string `json:"channel_id"`
|
|
UploaderID string `json:"uploader_id"`
|
|
Uploader string `json:"uploader"`
|
|
ChannelURL string `json:"channel_url"`
|
|
UploaderURL string `json:"uploader_url"`
|
|
Type string `json:"_type"`
|
|
Entries []Entry `json:"entries,omitempty"`
|
|
ExtractorKey string `json:"extractor_key"`
|
|
Extractor string `json:"extractor"`
|
|
WebpageURL string `json:"webpage_url"`
|
|
OriginalURL string `json:"original_url"`
|
|
WebpageURLBasename string `json:"webpage_url_basename"`
|
|
WebpageURLDomain string `json:"webpage_url_domain"`
|
|
ReleaseYear interface{} `json:"release_year"`
|
|
Epoch int64 `json:"epoch"`
|
|
FilesToMove *FilesToMove `json:"__files_to_move,omitempty"`
|
|
Version Version `json:"_version"`
|
|
Formats []Format `json:"formats,omitempty"`
|
|
Thumbnail *string `json:"thumbnail,omitempty"`
|
|
Duration *int64 `json:"duration,omitempty"`
|
|
AverageRating interface{} `json:"average_rating"`
|
|
AgeLimit *int64 `json:"age_limit,omitempty"`
|
|
Categories []string `json:"categories,omitempty"`
|
|
PlayableInEmbed *bool `json:"playable_in_embed,omitempty"`
|
|
LiveStatus *string `json:"live_status,omitempty"`
|
|
ReleaseTimestamp interface{} `json:"release_timestamp"`
|
|
FormatSortFields []string `json:"_format_sort_fields,omitempty"`
|
|
AutomaticCaptions map[string][]AutomaticCaption `json:"automatic_captions,omitempty"`
|
|
Subtitles *FilesToMove `json:"subtitles,omitempty"`
|
|
CommentCount *int64 `json:"comment_count,omitempty"`
|
|
Chapters interface{} `json:"chapters"`
|
|
Heatmap []Heatmap `json:"heatmap,omitempty"`
|
|
LikeCount *int64 `json:"like_count,omitempty"`
|
|
ChannelIsVerified *bool `json:"channel_is_verified,omitempty"`
|
|
UploadDate *string `json:"upload_date,omitempty"`
|
|
Timestamp *int64 `json:"timestamp,omitempty"`
|
|
Playlist interface{} `json:"playlist"`
|
|
PlaylistIndex interface{} `json:"playlist_index"`
|
|
DisplayID *string `json:"display_id,omitempty"`
|
|
Fulltitle *string `json:"fulltitle,omitempty"`
|
|
DurationString *string `json:"duration_string,omitempty"`
|
|
IsLive *bool `json:"is_live,omitempty"`
|
|
WasLive *bool `json:"was_live,omitempty"`
|
|
RequestedSubtitles interface{} `json:"requested_subtitles"`
|
|
HasDRM interface{} `json:"_has_drm"`
|
|
RequestedDownloads []RequestedDownload `json:"requested_downloads,omitempty"`
|
|
RequestedFormats []Format `json:"requested_formats,omitempty"`
|
|
Format *string `json:"format,omitempty"`
|
|
FormatID *string `json:"format_id,omitempty"`
|
|
EXT *MediaEXT `json:"ext,omitempty"`
|
|
Protocol *string `json:"protocol,omitempty"`
|
|
Language *Language `json:"language,omitempty"`
|
|
FormatNote *string `json:"format_note,omitempty"`
|
|
FilesizeApprox *int64 `json:"filesize_approx,omitempty"`
|
|
Tbr *float64 `json:"tbr,omitempty"`
|
|
Width *int64 `json:"width,omitempty"`
|
|
Height *int64 `json:"height,omitempty"`
|
|
Resolution *Resolution `json:"resolution,omitempty"`
|
|
FPS *int64 `json:"fps,omitempty"`
|
|
DynamicRange *DynamicRange `json:"dynamic_range,omitempty"`
|
|
Vcodec *string `json:"vcodec,omitempty"`
|
|
Vbr *float64 `json:"vbr,omitempty"`
|
|
StretchedRatio interface{} `json:"stretched_ratio"`
|
|
AspectRatio *float64 `json:"aspect_ratio,omitempty"`
|
|
Acodec *Acodec `json:"acodec,omitempty"`
|
|
ABR *float64 `json:"abr,omitempty"`
|
|
ASR *int64 `json:"asr,omitempty"`
|
|
AudioChannels *int64 `json:"audio_channels,omitempty"`
|
|
}
|
|
|
|
type AutomaticCaption struct {
|
|
EXT AutomaticCaptionEXT `json:"ext"`
|
|
URL string `json:"url"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type Entry struct {
|
|
ID string `json:"id"`
|
|
Title string `json:"title"`
|
|
Formats []Format `json:"formats"`
|
|
Thumbnails []Thumbnail `json:"thumbnails"`
|
|
Thumbnail string `json:"thumbnail"`
|
|
Description string `json:"description"`
|
|
ChannelID string `json:"channel_id"`
|
|
ChannelURL string `json:"channel_url"`
|
|
Duration int64 `json:"duration"`
|
|
ViewCount int64 `json:"view_count"`
|
|
AverageRating interface{} `json:"average_rating"`
|
|
AgeLimit int64 `json:"age_limit"`
|
|
WebpageURL string `json:"webpage_url"`
|
|
Categories []string `json:"categories"`
|
|
Tags []string `json:"tags"`
|
|
PlayableInEmbed bool `json:"playable_in_embed"`
|
|
LiveStatus string `json:"live_status"`
|
|
ReleaseTimestamp interface{} `json:"release_timestamp"`
|
|
FormatSortFields []string `json:"_format_sort_fields"`
|
|
AutomaticCaptions map[string][]AutomaticCaption `json:"automatic_captions"`
|
|
Subtitles FilesToMove `json:"subtitles"`
|
|
CommentCount int64 `json:"comment_count"`
|
|
Chapters interface{} `json:"chapters"`
|
|
Heatmap interface{} `json:"heatmap"`
|
|
LikeCount int64 `json:"like_count"`
|
|
Channel string `json:"channel"`
|
|
ChannelFollowerCount int64 `json:"channel_follower_count"`
|
|
Uploader string `json:"uploader"`
|
|
UploaderID string `json:"uploader_id"`
|
|
UploaderURL string `json:"uploader_url"`
|
|
UploadDate string `json:"upload_date"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
Availability string `json:"availability"`
|
|
OriginalURL string `json:"original_url"`
|
|
WebpageURLBasename string `json:"webpage_url_basename"`
|
|
WebpageURLDomain string `json:"webpage_url_domain"`
|
|
Extractor string `json:"extractor"`
|
|
ExtractorKey string `json:"extractor_key"`
|
|
PlaylistCount int64 `json:"playlist_count"`
|
|
Playlist string `json:"playlist"`
|
|
PlaylistID string `json:"playlist_id"`
|
|
PlaylistTitle string `json:"playlist_title"`
|
|
PlaylistUploader string `json:"playlist_uploader"`
|
|
PlaylistUploaderID string `json:"playlist_uploader_id"`
|
|
NEntries int64 `json:"n_entries"`
|
|
PlaylistIndex int64 `json:"playlist_index"`
|
|
LastPlaylistIndex int64 `json:"__last_playlist_index"`
|
|
PlaylistAutonumber int64 `json:"playlist_autonumber"`
|
|
DisplayID string `json:"display_id"`
|
|
Fulltitle string `json:"fulltitle"`
|
|
DurationString string `json:"duration_string"`
|
|
ReleaseYear interface{} `json:"release_year"`
|
|
IsLive bool `json:"is_live"`
|
|
WasLive bool `json:"was_live"`
|
|
RequestedSubtitles interface{} `json:"requested_subtitles"`
|
|
HasDRM interface{} `json:"_has_drm"`
|
|
Epoch int64 `json:"epoch"`
|
|
RequestedDownloads []RequestedDownload `json:"requested_downloads"`
|
|
RequestedFormats []Format `json:"requested_formats"`
|
|
Format string `json:"format"`
|
|
FormatID string `json:"format_id"`
|
|
EXT string `json:"ext"`
|
|
Protocol string `json:"protocol"`
|
|
Language *Language `json:"language"`
|
|
FormatNote string `json:"format_note"`
|
|
FilesizeApprox int64 `json:"filesize_approx"`
|
|
Tbr float64 `json:"tbr"`
|
|
Width int64 `json:"width"`
|
|
Height int64 `json:"height"`
|
|
Resolution Resolution `json:"resolution"`
|
|
FPS int64 `json:"fps"`
|
|
DynamicRange DynamicRange `json:"dynamic_range"`
|
|
Vcodec string `json:"vcodec"`
|
|
Vbr float64 `json:"vbr"`
|
|
StretchedRatio interface{} `json:"stretched_ratio"`
|
|
AspectRatio float64 `json:"aspect_ratio"`
|
|
Acodec Acodec `json:"acodec"`
|
|
ABR float64 `json:"abr"`
|
|
ASR int64 `json:"asr"`
|
|
AudioChannels int64 `json:"audio_channels"`
|
|
}
|
|
|
|
type Format struct {
|
|
FormatID string `json:"format_id"`
|
|
FormatNote *FormatNote `json:"format_note,omitempty"`
|
|
EXT MediaEXT `json:"ext"`
|
|
Protocol Protocol `json:"protocol"`
|
|
Acodec *Acodec `json:"acodec,omitempty"`
|
|
Vcodec string `json:"vcodec"`
|
|
URL string `json:"url"`
|
|
Width *int64 `json:"width"`
|
|
Height *int64 `json:"height"`
|
|
FPS *float64 `json:"fps"`
|
|
Rows *int64 `json:"rows,omitempty"`
|
|
Columns *int64 `json:"columns,omitempty"`
|
|
Fragments []Fragment `json:"fragments,omitempty"`
|
|
Resolution Resolution `json:"resolution"`
|
|
AspectRatio *float64 `json:"aspect_ratio"`
|
|
FilesizeApprox *int64 `json:"filesize_approx"`
|
|
HTTPHeaders HTTPHeaders `json:"http_headers"`
|
|
AudioEXT MediaEXT `json:"audio_ext"`
|
|
VideoEXT MediaEXT `json:"video_ext"`
|
|
Vbr *float64 `json:"vbr"`
|
|
ABR *float64 `json:"abr"`
|
|
Tbr *float64 `json:"tbr"`
|
|
Format string `json:"format"`
|
|
FormatIndex interface{} `json:"format_index"`
|
|
ManifestURL *string `json:"manifest_url,omitempty"`
|
|
Language *Language `json:"language"`
|
|
Preference interface{} `json:"preference"`
|
|
Quality *float64 `json:"quality,omitempty"`
|
|
HasDRM *bool `json:"has_drm,omitempty"`
|
|
SourcePreference *int64 `json:"source_preference,omitempty"`
|
|
ASR *int64 `json:"asr"`
|
|
Filesize *int64 `json:"filesize"`
|
|
AudioChannels *int64 `json:"audio_channels"`
|
|
LanguagePreference *int64 `json:"language_preference,omitempty"`
|
|
DynamicRange *DynamicRange `json:"dynamic_range"`
|
|
Container *Container `json:"container,omitempty"`
|
|
DownloaderOptions *DownloaderOptions `json:"downloader_options,omitempty"`
|
|
}
|
|
|
|
type DownloaderOptions struct {
|
|
HTTPChunkSize int64 `json:"http_chunk_size"`
|
|
}
|
|
|
|
type Fragment struct {
|
|
URL string `json:"url"`
|
|
Duration float64 `json:"duration"`
|
|
}
|
|
|
|
type HTTPHeaders struct {
|
|
UserAgent string `json:"User-Agent"`
|
|
Accept Accept `json:"Accept"`
|
|
AcceptLanguage AcceptLanguage `json:"Accept-Language"`
|
|
SECFetchMode SECFetchMode `json:"Sec-Fetch-Mode"`
|
|
}
|
|
|
|
type RequestedDownload struct {
|
|
RequestedFormats []Format `json:"requested_formats"`
|
|
Format string `json:"format"`
|
|
FormatID string `json:"format_id"`
|
|
EXT string `json:"ext"`
|
|
Protocol string `json:"protocol"`
|
|
FormatNote string `json:"format_note"`
|
|
FilesizeApprox int64 `json:"filesize_approx"`
|
|
Tbr float64 `json:"tbr"`
|
|
Width int64 `json:"width"`
|
|
Height int64 `json:"height"`
|
|
Resolution Resolution `json:"resolution"`
|
|
FPS int64 `json:"fps"`
|
|
DynamicRange DynamicRange `json:"dynamic_range"`
|
|
Vcodec string `json:"vcodec"`
|
|
Vbr float64 `json:"vbr"`
|
|
AspectRatio float64 `json:"aspect_ratio"`
|
|
Acodec Acodec `json:"acodec"`
|
|
ABR float64 `json:"abr"`
|
|
ASR int64 `json:"asr"`
|
|
AudioChannels int64 `json:"audio_channels"`
|
|
FilenameOld string `json:"_filename"`
|
|
Filename string `json:"filename"`
|
|
WriteDownloadArchive bool `json:"__write_download_archive"`
|
|
Language *Language `json:"language,omitempty"`
|
|
}
|
|
|
|
type FilesToMove struct {
|
|
}
|
|
|
|
type Thumbnail struct {
|
|
URL string `json:"url"`
|
|
Preference *int64 `json:"preference,omitempty"`
|
|
ID string `json:"id"`
|
|
Height *int64 `json:"height,omitempty"`
|
|
Width *int64 `json:"width,omitempty"`
|
|
Resolution *string `json:"resolution,omitempty"`
|
|
}
|
|
|
|
type Heatmap struct {
|
|
StartTime float64 `json:"start_time"`
|
|
EndTime float64 `json:"end_time"`
|
|
Value float64 `json:"value"`
|
|
}
|
|
|
|
type Version struct {
|
|
Version string `json:"version"`
|
|
CurrentGitHead interface{} `json:"current_git_head"`
|
|
ReleaseGitHead string `json:"release_git_head"`
|
|
Repository string `json:"repository"`
|
|
}
|
|
|
|
type Acodec string
|
|
|
|
const (
|
|
AcodecNone Acodec = "none"
|
|
Mp4A402 Acodec = "mp4a.40.2"
|
|
Mp4A405 Acodec = "mp4a.40.5"
|
|
Opus Acodec = "opus"
|
|
)
|
|
|
|
type AutomaticCaptionEXT string
|
|
|
|
const (
|
|
Json3 AutomaticCaptionEXT = "json3"
|
|
Srv1 AutomaticCaptionEXT = "srv1"
|
|
Srv2 AutomaticCaptionEXT = "srv2"
|
|
Srv3 AutomaticCaptionEXT = "srv3"
|
|
Ttml AutomaticCaptionEXT = "ttml"
|
|
Vtt AutomaticCaptionEXT = "vtt"
|
|
)
|
|
|
|
type DynamicRange string
|
|
|
|
const (
|
|
SDR DynamicRange = "SDR"
|
|
HDR DynamicRange = "HDR"
|
|
)
|
|
|
|
type MediaEXT string
|
|
|
|
const (
|
|
EXTNone MediaEXT = "none"
|
|
EXTMhtml MediaEXT = "mhtml"
|
|
M4A MediaEXT = "m4a"
|
|
Mp4 MediaEXT = "mp4"
|
|
Webm MediaEXT = "webm"
|
|
)
|
|
|
|
type Container string
|
|
|
|
const (
|
|
M4ADash Container = "m4a_dash"
|
|
Mp4Dash Container = "mp4_dash"
|
|
WebmDash Container = "webm_dash"
|
|
)
|
|
|
|
type FormatNote string
|
|
|
|
const (
|
|
Default FormatNote = "Default"
|
|
Low FormatNote = "low"
|
|
Medium FormatNote = "medium"
|
|
Premium FormatNote = "Premium"
|
|
Storyboard FormatNote = "storyboard"
|
|
The1080P FormatNote = "1080p"
|
|
The144P FormatNote = "144p"
|
|
The240P FormatNote = "240p"
|
|
The360P FormatNote = "360p"
|
|
The480P FormatNote = "480p"
|
|
The720P FormatNote = "720p"
|
|
)
|
|
|
|
type Accept string
|
|
|
|
const (
|
|
TextHTMLApplicationXHTMLXMLApplicationXMLQ09Q08 Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
|
)
|
|
|
|
type AcceptLanguage string
|
|
|
|
const (
|
|
EnUsEnQ05 AcceptLanguage = "en-us,en;q=0.5"
|
|
)
|
|
|
|
type SECFetchMode string
|
|
|
|
const (
|
|
Navigate SECFetchMode = "navigate"
|
|
)
|
|
|
|
type Language string
|
|
|
|
const (
|
|
En Language = "en"
|
|
)
|
|
|
|
type Protocol string
|
|
|
|
const (
|
|
HTTPS Protocol = "https"
|
|
M3U8Native Protocol = "m3u8_native"
|
|
ProtocolMhtml Protocol = "mhtml"
|
|
)
|
|
|
|
type Resolution string
|
|
|
|
const (
|
|
AudioOnly Resolution = "audio only"
|
|
The1280X720 Resolution = "1280x720"
|
|
The160X90 Resolution = "160x90"
|
|
The1920X1080 Resolution = "1920x1080"
|
|
The256X144 Resolution = "256x144"
|
|
The320X180 Resolution = "320x180"
|
|
The426X240 Resolution = "426x240"
|
|
The48X27 Resolution = "48x27"
|
|
The640X360 Resolution = "640x360"
|
|
The80X45 Resolution = "80x45"
|
|
The854X480 Resolution = "854x480"
|
|
)
|