Documentation
¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func ConvertVote(vote string) (int, error)
- func CreatePlaylist(playlist Playlist, db *gorm.DB) (string, error)
- func DeleteSponsorBlock(sponsorBlock SponsorBlock, db *gorm.DB) error
- func DeleteUser(userID string, db *gorm.DB) error
- func DeleteVideo(videoID string, db *gorm.DB) error
- func GetCommentPath(videoID string, db *gorm.DB) (string, error)
- func GetCreatorVideoCount(creatorID string, db *gorm.DB) (int, error)
- func GetDatabase() (*gorm.DB, error)
- func GetPlaylistByUserID(userID string, playlistName string, db *gorm.DB) ([]string, error)
- func GetSponsorBlockSettings(user_id string, db *gorm.DB) (bool, string, error)
- func GetValidUserTypes() []string
- func GetVideoProgress(videoID string, userID string, db *gorm.DB) (string, error)
- func HashPassword(password string) (string, error)
- func ImportMetadata(creator string, settings *Settings, db *gorm.DB) error
- func ImportTwitchMetadata(creator string, settings *Settings, db *gorm.DB) error
- func InsertComment(comment Comment, db *gorm.DB) error
- func InsertCreator(creator Creator, db *gorm.DB) error
- func InsertDownloadQueueItem(item DownloadQueue, db *gorm.DB) error
- func InsertSponsorBlock(sponsorBlock SponsorBlock, db *gorm.DB) error
- func InsertTask(t Tasking, db *gorm.DB) error
- func InsertTweet(tweet Tweet, db *gorm.DB) error
- func InsertVideo(video Video, db *gorm.DB) error
- func RandomString(length int) string
- func RemoveFromDownloadQueue(videoID string, videotype string, db *gorm.DB) error
- func ScanLibraryAndAddToDatabase(settings *Settings, db *gorm.DB) error
- func SetSettings(settings Settings, db *gorm.DB) error
- func SetTaskEpochLastRan(task Tasking, db *gorm.DB) error
- func SignupUser(user User, db *gorm.DB) error
- func UpdateComment(comment Comment, db *gorm.DB) error
- func UpdateCreator(creator Creator, db *gorm.DB) error
- func UpdateDownloadQueueItem(item DownloadQueue, altVidID string, db *gorm.DB) error
- func UpdatePlaylist(playlist Playlist, db *gorm.DB) error
- func UpdatePlaylistByUserId(userID string, playlistName string, videoIDJson string, db *gorm.DB) error
- func UpdateTaskEpoch(task *Tasking, db *gorm.DB) error
- func UpdateTaskEpochByName(taskName string, epoch int64, db *gorm.DB) error
- func UpdateTaskEpochLastRanByName(taskName string, epoch int64, db *gorm.DB) error
- func UpdateTweet(tweet Tweet, db *gorm.DB) error
- func UpdateUser(user User, db *gorm.DB) error
- func UpdateUserProgress(userID string, progressJsonString string, db *gorm.DB) error
- func UpdateUserSponsorblockEnabled(userID string, sponsorblockEnabled bool, db *gorm.DB) error
- func UpdateVideo(video Video, db *gorm.DB) error
- type Comment
- type Creator
- type DownloadQueue
- type FileJsonSponsorBlock
- type LoginData
- type Playlist
- type ProgressToken
- type Settings
- type SponsorBlock
- type SponsorBlockRawApi
- type Tasking
- type Tweet
- type User
- type VidSubtitle
- type Video
- type YouTubeApiVideoInfoStruct
- type YouTubeApiVideoInfoStructSub
- type YouTubeVideoInfoStruct
- type YoutubePlaylistStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
Use bcrypt to compare a password and a hash
func ConvertVote ¶
func DeleteSponsorBlock ¶
func DeleteSponsorBlock(sponsorBlock SponsorBlock, db *gorm.DB) error
func GetDatabase ¶
func GetPlaylistByUserID ¶
func GetSponsorBlockSettings ¶
func GetValidUserTypes ¶
func GetValidUserTypes() []string
func GetVideoProgress ¶
create GetVideoProgress(videoid, c.GetString("user_id"), db). Stored in User.Progress as a json string formatted as [{"videoID": progress}]
func HashPassword ¶
Use bcrypt to hash a password
func ImportMetadata ¶
import creator metadata from path ${creator}/${cretor}.json and video metadata are stroed in multiple files formatted ${creator}/metadata/metadata/${video}.json
func ImportTwitchMetadata ¶
func InsertDownloadQueueItem ¶
func InsertDownloadQueueItem(item DownloadQueue, db *gorm.DB) error
Insert download queue item
func InsertSponsorBlock ¶
func InsertSponsorBlock(sponsorBlock SponsorBlock, db *gorm.DB) error
func RandomString ¶
func RemoveFromDownloadQueue ¶
func UpdateDownloadQueueItem ¶
func UpdateDownloadQueueItem(item DownloadQueue, altVidID string, db *gorm.DB) error
func UpdatePlaylistByUserId ¶
func UpdateTaskEpochByName ¶
func UpdateUserProgress ¶
Types ¶
type Comment ¶
type Creator ¶
type DownloadQueue ¶
type DownloadQueue struct { gorm.Model ID int `gorm:"primaryKey"` VideoID string DownloadPath string VideoType string Source string Requester string Running bool Downloaded bool Approved bool FilePath string }
func GetDownloadQueue ¶
func GetDownloadQueue(db *gorm.DB) ([]DownloadQueue, error)
get DownloadQueue from database
func GetDownloadQueueItem ¶
type FileJsonSponsorBlock ¶
type FileJsonSponsorBlock struct { SegmentCount int `json:"segmentCount"` Page int `json:"page"` Segments []struct { UUID string `json:"UUID"` TimeSubmitted int64 `json:"timeSubmitted"` StartTime float64 `json:"startTime"` EndTime float64 `json:"endTime"` Category string `json:"category"` ActionType string `json:"actionType"` Votes int `json:"votes"` Views int `json:"views"` Locked int `json:"locked"` Hidden int `json:"hidden"` ShadowHidden int `json:"shadowHidden"` UserID string `json:"userID"` Description string `json:"description"` } `json:"segments"` }
type Playlist ¶
type ProgressToken ¶
type ProgressToken struct { VideoID string `json:"video_id"` Progress string `json:"progress" binding:"required"` }
func GetAllVideoProgress ¶
func GetAllVideoProgress(userID string, db *gorm.DB) ([]ProgressToken, error)
type Settings ¶
type Settings struct { gorm.Model ID int `gorm:"primaryKey"` BaseYouTubePath string BaseTwitchPath string BaseTwitterPath string DatabasePath string DatabaseType string DatabaseHost string DatabasePort string DatabaseUser string DatabasePass string DatabaseName string DatabaseSSLMode string DatabaseTimeZone string RedisAddress string RedisPassword string ServerPath string RedisDB int JwtSecret string OpenRegister bool PublicImages bool }
type SponsorBlock ¶
type SponsorBlock struct { gorm.Model Deleted gorm.DeletedAt ID int `gorm:"primaryKey"` VideoID string SegmentID string SegmentStart float64 SegmentEnd float64 Category string ActionType string Hidden int ShadowHidden int Votes int FilePath string }
func GetAllVideoSponsoBlock ¶
func GetAllVideoSponsoBlock(db *gorm.DB) ([]SponsorBlock, error)
func GetVideoSponsorBlock ¶
func GetVideoSponsorBlock(video string, db *gorm.DB) ([]SponsorBlock, error)
type SponsorBlockRawApi ¶
type SponsorBlockRawApi struct { SegmentCount int `json:"segmentCount"` Page int `json:"page"` Segments []struct { UUID string `json:"UUID"` TimeSubmitted int64 `json:"timeSubmitted"` StartTime float64 `json:"startTime"` EndTime float64 `json:"endTime"` Category string `json:"category"` ActionType string `json:"actionType"` Votes int `json:"votes"` Views int `json:"views"` Locked int `json:"locked"` Hidden int `json:"hidden"` ShadowHidden int `json:"shadowHidden"` UserID string `json:"userID"` Description string `json:"description"` } `json:"segments"` }
type Tasking ¶
type Tweet ¶
type Tweet struct { gorm.Model ID int `gorm:"primaryKey"` TweetID string ConversationID string UserID string Username string UserDisplayName string Epoch int64 IsQuote bool QuoteID string IsReply bool InReplyToID string IsRetweet bool RetweetID string IsPin bool Likes int ReplyCount int RetweetCount int Photos string Videos string Text string URLs string FilePath string }
type User ¶
type VidSubtitle ¶
type VidSubtitle struct { Language string `json:"language"` LanguageText string FilePath string `json:"filepath"` }
func GetVideoSubtitles ¶
func GetVideoSubtitles(video string, db *gorm.DB) ([]VidSubtitle, error)
type Video ¶
type Video struct { gorm.Model ID int `gorm:"primaryKey"` VideoID string ChannelID string ChannelTitle string PublishedAt string Epoch int64 Title string Description string Views string Likes string Length string FilePath string MetadataPath string ThumbnailPath string CommentsPath string SubtitlePath string Availability string Progress string VideoType string Categories string Tags string Watched bool AgeRestricted bool Updated bool MimeType string SponsorTag string }
type YouTubeApiVideoInfoStruct ¶
type YouTubeApiVideoInfoStruct struct { Kind string `json:"kind"` Etag string `json:"etag"` ID string `json:"id"` Snippet struct { PublishedAt string `json:"publishedAt"` ChannelID string `json:"channelId"` Title string `json:"title"` Description string `json:"description"` Thumbnails struct { Default struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"default"` Medium struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"medium"` High struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"high"` Standard struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"standard"` Maxres struct { URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"maxres"` } `json:"thumbnails"` ChannelTitle string `json:"channelTitle"` Tags []string `json:"tags"` CategoryID string `json:"categoryId"` LiveBroadcastContent string `json:"liveBroadcastContent"` DefaultLanguage string `json:"defaultLanguage"` Localized struct { Title string `json:"title"` Description string `json:"description"` } `json:"localized"` DefaultAudioLanguage string `json:"defaultAudioLanguage"` } `json:"snippet"` ContentDetails struct { Duration string `json:"duration"` Dimension string `json:"dimension"` Definition string `json:"definition"` Caption string `json:"caption"` LicensedContent bool `json:"licensedContent"` RegionRestriction interface{} `json:"regionRestriction"` ContentRating struct { } `json:"contentRating"` Projection string `json:"projection"` HasCustomThumbnail interface{} `json:"hasCustomThumbnail"` } `json:"contentDetails"` Status struct { UploadStatus string `json:"uploadStatus"` FailureReason interface{} `json:"failureReason"` RejectionReason interface{} `json:"rejectionReason"` PrivacyStatus string `json:"privacyStatus"` PublishAt interface{} `json:"publishAt"` License string `json:"license"` Embeddable bool `json:"embeddable"` PublicStatsViewable bool `json:"publicStatsViewable"` MadeForKids bool `json:"madeForKids"` SelfDeclaredMadeForKids interface{} `json:"selfDeclaredMadeForKids"` } `json:"status"` Statistics struct { ViewCount string `json:"viewCount"` LikeCount string `json:"likeCount"` DislikeCount interface{} `json:"dislikeCount"` CommentCount string `json:"commentCount"` } `json:"statistics"` TopicDetails struct { TopicIds interface{} `json:"topicIds"` RelevantTopicIds interface{} `json:"relevantTopicIds"` TopicCategories []string `json:"topicCategories"` } `json:"topicDetails"` LiveStreamingDetails interface{} `json:"liveStreamingDetails"` }
type YouTubeVideoInfoStruct ¶
type YouTubeVideoInfoStruct struct { ID string `json:"id"` Title string `json:"title"` Formats []struct { FormatID string `json:"format_id"` FormatNote string `json:"format_note"` Ext string `json:"ext"` Protocol string `json:"protocol"` Acodec string `json:"acodec"` Vcodec string `json:"vcodec"` URL string `json:"url"` Width int `json:"width"` Height int `json:"height"` Fps float64 `json:"fps"` Rows int `json:"rows,omitempty"` Columns int `json:"columns,omitempty"` Fragments []struct { URL string `json:"url"` Duration float64 `json:"duration"` } `json:"fragments,omitempty"` Resolution string `json:"resolution"` AspectRatio float64 `json:"aspect_ratio"` HTTPHeaders struct { UserAgent string `json:"User-Agent"` Accept string `json:"Accept"` AcceptLanguage string `json:"Accept-Language"` SecFetchMode string `json:"Sec-Fetch-Mode"` } `json:"http_headers"` AudioExt string `json:"audio_ext"` VideoExt string `json:"video_ext"` Format string `json:"format"` Asr int `json:"asr,omitempty"` Filesize int `json:"filesize,omitempty"` SourcePreference int `json:"source_preference,omitempty"` AudioChannels int `json:"audio_channels,omitempty"` Quality float64 `json:"quality,omitempty"` HasDrm interface{} `json:"has_drm,omitempty"` Tbr float64 `json:"tbr,omitempty"` Language interface{} `json:"language,omitempty"` LanguagePreference int `json:"language_preference,omitempty"` Preference interface{} `json:"preference,omitempty"` DynamicRange interface{} `json:"dynamic_range,omitempty"` Abr float64 `json:"abr,omitempty"` Container string `json:"container,omitempty"` Vbr float64 `json:"vbr,omitempty"` FilesizeApprox int `json:"filesize_approx,omitempty"` } `json:"formats"` Thumbnails []struct { URL string `json:"url"` Preference int `json:"preference"` ID string `json:"id"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` Resolution string `json:"resolution,omitempty"` } `json:"thumbnails"` Thumbnail string `json:"thumbnail"` Description string `json:"description"` Uploader string `json:"uploader"` UploaderID string `json:"uploader_id"` UploaderURL string `json:"uploader_url"` ChannelID string `json:"channel_id"` ChannelURL string `json:"channel_url"` Duration int `json:"duration"` ViewCount int `json:"view_count"` AverageRating interface{} `json:"average_rating"` AgeLimit int `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 int `json:"release_timestamp"` FormatSortFields []string `json:"_format_sort_fields"` Subtitles map[string][]YouTubeApiVideoInfoStructSub `json:"subtitles"` CommentCount int `json:"comment_count"` Chapters interface{} `json:"chapters"` LikeCount int `json:"like_count"` Channel string `json:"channel"` ChannelFollowerCount int `json:"channel_follower_count"` UploadDate string `json:"upload_date"` 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"` Playlist interface{} `json:"playlist"` PlaylistIndex interface{} `json:"playlist_index"` DisplayID string `json:"display_id"` Fulltitle string `json:"fulltitle"` DurationString string `json:"duration_string"` ReleaseDate string `json:"release_date"` IsLive bool `json:"is_live"` WasLive bool `json:"was_live"` RequestedSubtitles interface{} `json:"requested_subtitles"` HasDrm interface{} `json:"_has_drm"` Comments []struct { ID string `json:"id"` Text string `json:"text"` Timestamp int `json:"timestamp"` TimeText string `json:"time_text"` LikeCount int `json:"like_count"` IsFavorited bool `json:"is_favorited"` Author string `json:"author"` AuthorID string `json:"author_id"` AuthorThumbnail string `json:"author_thumbnail"` AuthorIsUploader bool `json:"author_is_uploader"` Parent string `json:"parent"` } `json:"comments"` RequestedFormats []struct { Asr interface{} `json:"asr"` Filesize int `json:"filesize"` FormatID string `json:"format_id"` FormatNote string `json:"format_note"` SourcePreference int `json:"source_preference"` Fps float64 `json:"fps"` AudioChannels interface{} `json:"audio_channels"` Height int `json:"height"` Quality float64 `json:"quality"` HasDrm interface{} `json:"has_drm"` Tbr float64 `json:"tbr"` URL string `json:"url"` Width int `json:"width"` Language interface{} `json:"language"` LanguagePreference int `json:"language_preference"` Preference interface{} `json:"preference"` Ext string `json:"ext"` Vcodec string `json:"vcodec"` Acodec string `json:"acodec"` DynamicRange string `json:"dynamic_range"` Vbr float64 `json:"vbr,omitempty"` Protocol string `json:"protocol"` Fragments []struct { URL string `json:"url"` } `json:"fragments"` Container string `json:"container"` Resolution string `json:"resolution"` AspectRatio float64 `json:"aspect_ratio"` HTTPHeaders struct { UserAgent string `json:"User-Agent"` Accept string `json:"Accept"` AcceptLanguage string `json:"Accept-Language"` SecFetchMode string `json:"Sec-Fetch-Mode"` } `json:"http_headers"` VideoExt string `json:"video_ext"` AudioExt string `json:"audio_ext"` Format string `json:"format"` Abr float64 `json:"abr,omitempty"` } `json:"requested_formats"` Format string `json:"format"` FormatID string `json:"format_id"` Ext string `json:"ext"` Protocol string `json:"protocol"` Language interface{} `json:"language"` FormatNote string `json:"format_note"` FilesizeApprox int `json:"filesize_approx"` Tbr float64 `json:"tbr"` Width int `json:"width"` Height int `json:"height"` Resolution string `json:"resolution"` Fps float64 `json:"fps"` DynamicRange string `json:"dynamic_range"` Vcodec string `json:"vcodec"` Vbr float64 `json:"vbr"` StretchedRatio interface{} `json:"stretched_ratio"` AspectRatio float64 `json:"aspect_ratio"` Acodec string `json:"acodec"` Abr float64 `json:"abr"` Asr int `json:"asr"` AudioChannels int `json:"audio_channels"` Epoch int `json:"epoch"` Filename string `json:"_filename"` Filename0 string `json:"filename"` Urls string `json:"urls"` Type string `json:"_type"` Version struct { Version string `json:"version"` CurrentGitHead interface{} `json:"current_git_head"` ReleaseGitHead string `json:"release_git_head"` Repository string `json:"repository"` } `json:"_version"` }
type YoutubePlaylistStruct ¶
type YoutubePlaylistStruct struct { ID string `json:"id"` Uploader string `json:"uploader"` UploaderID string `json:"uploader_id"` UploaderURL string `json:"uploader_url"` Title string `json:"title"` Availability interface{} `json:"availability"` ChannelFollowerCount int `json:"channel_follower_count"` Description string `json:"description"` Tags []string `json:"tags"` Thumbnails []struct { URL string `json:"url"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` Preference int `json:"preference,omitempty"` ID string `json:"id"` Resolution string `json:"resolution,omitempty"` } `json:"thumbnails"` ModifiedDate interface{} `json:"modified_date"` ViewCount int64 `json:"view_count"` PlaylistCount int `json:"playlist_count"` Channel string `json:"channel"` ChannelID string `json:"channel_id"` ChannelURL string `json:"channel_url"` Type string `json:"_type"` Entries []interface{} `json:"entries"` 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"` FilesToMove struct { } `json:"__files_to_move"` Epoch int `json:"epoch"` Version struct { Version string `json:"version"` CurrentGitHead interface{} `json:"current_git_head"` ReleaseGitHead string `json:"release_git_head"` Repository string `json:"repository"` } `json:"_version"` }
Click to show internal directories.
Click to hide internal directories.