Download video to sync to local cache #113
131
local/local.go
|
@ -1,20 +1,17 @@
|
|||
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
package local
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
"errors"
|
||||
"fmt"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
"io/ioutil"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
"os"
|
||||
"path"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/abadojack/whatlanggo"
|
||||
|
||||
"github.com/lbryio/ytsync/v5/downloader/ytdl"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
"github.com/lbryio/lbry.go/v2/extras/util"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
"github.com/lbryio/ytsync/v5/namer"
|
||||
"github.com/lbryio/ytsync/v5/tags_manager"
|
||||
)
|
||||
|
@ -24,6 +21,7 @@ type SyncContext struct {
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
LbrynetAddr string
|
||||
ChannelID string
|
||||
PublishBid float64
|
||||
YouTubeSourceConfig *YouTubeSourceConfig
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
|
||||
func (c *SyncContext) Validate() error {
|
||||
|
@ -42,6 +40,10 @@ func (c *SyncContext) Validate() error {
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return nil
|
||||
}
|
||||
|
||||
type YouTubeSourceConfig struct {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
YouTubeAPIKey string
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
var syncContext SyncContext
|
||||
|
||||
func AddCommand(rootCmd *cobra.Command) {
|
||||
|
@ -55,6 +57,10 @@ func AddCommand(rootCmd *cobra.Command) {
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
cmd.Flags().Float64Var(&syncContext.PublishBid, "publish-bid", 0.01, "Bid amount for the stream claim")
|
||||
cmd.Flags().StringVar(&syncContext.LbrynetAddr, "lbrynet-address", getEnvDefault("LBRYNET_ADDRESS", ""), "JSONRPC address of the local LBRYNet daemon")
|
||||
cmd.Flags().StringVar(&syncContext.ChannelID, "channel-id", "", "LBRY channel ID to publish to")
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
// For now, assume source is always YouTube
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
syncContext.YouTubeSourceConfig = &YouTubeSourceConfig{}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
cmd.Flags().StringVar(&syncContext.YouTubeSourceConfig.YouTubeAPIKey, "youtube-api-key", getEnvDefault("YOUTUBE_API_KEY", ""), "YouTube API Key")
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
rootCmd.AddCommand(cmd)
|
||||
}
|
||||
|
||||
|
@ -71,11 +77,9 @@ func localCmd(cmd *cobra.Command, args []string) {
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
fmt.Println(syncContext.LbrynetAddr)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
videoID := args[0]
|
||||
|
||||
log.Debugf("Running sync for YouTube video ID %s", videoID)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Debugf("Running sync for video ID %s", videoID)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
var publisher VideoPublisher
|
||||
publisher, err = NewLocalSDKPublisher(syncContext.LbrynetAddr, syncContext.ChannelID, syncContext.PublishBid)
|
||||
|
@ -85,10 +89,12 @@ func localCmd(cmd *cobra.Command, args []string) {
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() prolly need to make sure this exists prolly need to make sure this exists
![]() This should be guaranteed by This should be guaranteed by `cobra.ExactArgs(1)`, but I can a check and error here too.
![]() you're right, i just didnt notice that you're right, i just didnt notice that
|
||||
|
||||
var videoSource VideoSource
|
||||
videoSource, err = NewYtdlVideoSource(syncContext.TempDir)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Errorf("Error setting up video source: %v", err)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if syncContext.YouTubeSourceConfig != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
videoSource, err = NewYtdlVideoSource(syncContext.TempDir, syncContext.YouTubeSourceConfig)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Errorf("Error setting up video source: %v", err)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
|
||||
sourceVideo, err := videoSource.GetVideo(videoID)
|
||||
|
@ -116,78 +122,6 @@ func localCmd(cmd *cobra.Command, args []string) {
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Info("Done")
|
||||
}
|
||||
|
||||
func getVideoMetadata(basePath, videoID string) (*ytdl.YtdlVideo, string, error) {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
metadataPath := basePath + ".info.json"
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
_, err := os.Stat(metadataPath)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Errorf("Error determining if video metadata already exists: %v", err)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return nil, "", err
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
} else if err == nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Debugf("Video metadata file %s already exists. Attempting to load existing file.", metadataPath)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
videoMetadata, err := loadVideoMetadata(metadataPath)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
log.Debugf("Error loading pre-existing video metadata: %v. Deleting file and attempting re-download.", err)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
} else {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return videoMetadata, metadataPath, nil
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err := downloadVideoMetadata(basePath, videoID); err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return nil, "", err
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
videoMetadata, err := loadVideoMetadata(metadataPath)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return videoMetadata, metadataPath, err
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
func loadVideoMetadata(path string) (*ytdl.YtdlVideo, error) {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
metadataBytes, err := os.ReadFile(path)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return nil, err
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
var videoMetadata *ytdl.YtdlVideo
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
err = json.Unmarshal(metadataBytes, &videoMetadata)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return nil, err
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return videoMetadata, nil
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
func getVideoDownloadedPath(videoDir, videoID string) (string, error) {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
files, err := ioutil.ReadDir(videoDir)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if err != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return "", err
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
for _, f := range files {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if f.IsDir() {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
continue
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if path.Ext(f.Name()) == ".mp4" && strings.Contains(f.Name(), videoID) {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return path.Join(videoDir, f.Name()), nil
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return "", errors.New("could not find any downloaded videos")
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
func getAbbrevDescription(v SourceVideo) string {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if v.Description == nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return v.SourceURL
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
maxLength := 2800
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
description := strings.TrimSpace(*v.Description)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
additionalDescription := "\n" + v.SourceURL
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if len(description) > maxLength {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
description = description[:maxLength]
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return description + "\n..." + additionalDescription
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
type SourceVideo struct {
|
||||
ID string
|
||||
Title *string
|
||||
|
@ -243,9 +177,14 @@ func processVideoForPublishing(source SourceVideo, channelID string) (*Publishab
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
claimName := namer.NewNamer().GetNextName(title)
|
||||
|
||||
thumbnailURL := ""
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if source.ThumbnailURL != nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
thumbnailURL = *source.ThumbnailURL
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
thumbnailURL := source.ThumbnailURL
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if thumbnailURL == nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
thumbnailURL = util.PtrToString("")
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
releaseTime := source.ReleaseTime
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if releaseTime == nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
releaseTime = util.PtrToInt64(time.Now().Unix())
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
|
||||
processed := PublishableVideo {
|
||||
|
@ -254,8 +193,8 @@ func processVideoForPublishing(source SourceVideo, channelID string) (*Publishab
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
Description: getAbbrevDescription(source),
|
||||
Languages: languages,
|
||||
Tags: tags,
|
||||
ReleaseTime: *source.ReleaseTime,
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
ThumbnailURL: thumbnailURL,
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
ReleaseTime: *releaseTime,
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
ThumbnailURL: *thumbnailURL,
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
FullLocalPath: source.FullLocalPath,
|
||||
}
|
||||
|
||||
|
@ -264,6 +203,20 @@ func processVideoForPublishing(source SourceVideo, channelID string) (*Publishab
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return &processed, nil
|
||||
}
|
||||
|
||||
func getAbbrevDescription(v SourceVideo) string {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if v.Description == nil {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return v.SourceURL
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
maxLength := 2800
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
description := strings.TrimSpace(*v.Description)
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
additionalDescription := "\n" + v.SourceURL
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
if len(description) > maxLength {
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
description = description[:maxLength]
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
return description + "\n..." + additionalDescription
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
}
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
|
||||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
||||
type VideoSource interface {
|
||||
GetVideo(id string) (*SourceVideo, error)
|
||||
}
|
||||
|
|
|||
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
![]() i recommend os.ReadFile() to read the file in one go i recommend os.ReadFile() to read the file in one go
![]() id call this something other than id call this something other than `done` to make it clear its a channel that lets you know when the video is done reflecting
![]() minor nit, but doesn't this potentially make the description longer than the max length? minor nit, but doesn't this potentially make the description longer than the max length?
![]() This was mostly ripped from This was mostly ripped from `getAbbrevDescription` in sources/youtubeVideo.go. I didn't know exactly where the value of 2800 came from, so I just assumed the logic was correct. If it is supposed to be a limit on the total description length, I'll fix this.
![]() i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-) i think that's an estimate of how long the description can get before we hit the max claim size limit. id still fix it so the math is right though :-)
|
45
local/youtubeEnricher.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
package local
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/lbryio/lbry.go/v2/extras/util"
|
||||
)
|
||||
|
||||
type YouTubeVideoEnricher interface {
|
||||
EnrichMissing(source *SourceVideo) error
|
||||
}
|
||||
|
||||
type YouTubeAPIVideoEnricher struct {
|
||||
api *YouTubeAPI
|
||||
}
|
||||
|
||||
func NewYouTubeAPIVideoEnricher(apiKey string) (*YouTubeAPIVideoEnricher) {
|
||||
enricher := YouTubeAPIVideoEnricher{
|
||||
api: NewYouTubeAPI(apiKey),
|
||||
![]() so the best way to get the release time was via the api? if so, can you include instructions in your PR on what a user would need to do to get an api key? we'd also want to add handling in a later version for exceeding api limits so the best way to get the release time was via the api? if so, can you include instructions in your PR on what a user would need to do to get an api key? we'd also want to add handling in a later version for exceeding api limits
![]() This was the simplest and most direct way, and the API limits seem like more than enough for the single channel use-case (except on initial channel sync). Should I add the instructions to the local/readme.md? This was the simplest and most direct way, and the API limits seem like more than enough for the single channel use-case (except on initial channel sync). Should I add the instructions to the local/readme.md?
![]() yea yea
![]() maybe add a note to the issue to give the user a good error message if the api runs out of credits, and stop the sync. getting the release time right is fairly important so we don't want to guess or leave it empty. this could go under v4 maybe add a note to the issue to give the user a good error message if the api runs out of credits, and stop the sync. getting the release time right is fairly important so we don't want to guess or leave it empty. this could go under v4
|
||||
}
|
||||
return &enricher
|
||||
}
|
||||
|
||||
func (e *YouTubeAPIVideoEnricher) EnrichMissing(source *SourceVideo) error {
|
||||
if source.ReleaseTime != nil {
|
||||
log.Debugf("Video %s does not need enrichment. YouTubeAPIVideoEnricher is skipping.", source.ID)
|
||||
return nil
|
||||
}
|
||||
|
||||
snippet, err := e.api.GetVideoSnippet(source.ID)
|
||||
if err != nil {
|
||||
log.Errorf("Error snippet data for video %s: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
publishedAt, err := time.Parse(time.RFC3339, snippet.PublishedAt)
|
||||
if err != nil {
|
||||
log.Errorf("Error converting publishedAt to timestamp: %v", err)
|
||||
} else {
|
||||
source.ReleaseTime = util.PtrToInt64(publishedAt.Unix())
|
||||
}
|
||||
return nil
|
||||
}
|
83
local/ytapi.go
Normal file
|
@ -0,0 +1,83 @@
|
|||
package local
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type YouTubeAPI struct {
|
||||
apiKey string
|
||||
client *http.Client
|
||||
}
|
||||
|
||||
func NewYouTubeAPI(apiKey string) (*YouTubeAPI) {
|
||||
client := &http.Client {
|
||||
Transport: &http.Transport{
|
||||
MaxIdleConns: 10,
|
||||
IdleConnTimeout: 30 * time.Second,
|
||||
DisableCompression: true,
|
||||
},
|
||||
}
|
||||
|
||||
api := YouTubeAPI {
|
||||
apiKey: apiKey,
|
||||
client: client,
|
||||
}
|
||||
|
||||
return &api
|
||||
}
|
||||
|
||||
func (a *YouTubeAPI) GetVideoSnippet(videoID string) (*VideoSnippet, error) {
|
||||
req, err := http.NewRequest("GET", "https://youtube.googleapis.com/youtube/v3/videos", nil)
|
||||
if err != nil {
|
||||
log.Errorf("Error creating http client for YouTube API: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
query := req.URL.Query()
|
||||
query.Add("part", "snippet")
|
||||
query.Add("id", videoID)
|
||||
query.Add("key", a.apiKey)
|
||||
req.URL.RawQuery = query.Encode()
|
||||
|
||||
req.Header.Add("Accept", "application/json")
|
||||
|
||||
resp, err := a.client.Do(req)
|
||||
defer resp.Body.Close()
|
||||
if err != nil {
|
||||
log.Errorf("Error from YouTube API: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
log.Tracef("Response from YouTube API: %s", string(body[:]))
|
||||
|
||||
var result videoListResponse
|
||||
err = json.Unmarshal(body, &result)
|
||||
if err != nil {
|
||||
log.Errorf("Error deserializing video list response from YouTube API: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(result.Items) != 1 {
|
||||
err = fmt.Errorf("YouTube API responded with incorrect number of snippets (%d) while attempting to get snippet data for video %s", len(result.Items), videoID)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &result.Items[0].Snippet, nil
|
||||
}
|
||||
|
||||
type videoListResponse struct {
|
||||
Items []struct {
|
||||
Snippet VideoSnippet `json:"snippet"`
|
||||
} `json:"items"`
|
||||
}
|
||||
|
||||
type VideoSnippet struct {
|
||||
PublishedAt string `json:"publishedAt"`
|
||||
}
|
|
@ -1,18 +1,17 @@
|
|||
package local
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/lbryio/lbry.go/v2/extras/util"
|
||||
"github.com/lbryio/ytsync/v5/downloader/ytdl"
|
||||
)
|
||||
|
||||
type YtdlVideoSource struct {
|
||||
downloader Ytdl
|
||||
enrichers []YouTubeVideoEnricher
|
||||
}
|
||||
|
||||
func NewYtdlVideoSource(downloadDir string) (*YtdlVideoSource, error) {
|
||||
func NewYtdlVideoSource(downloadDir string, config *YouTubeSourceConfig) (*YtdlVideoSource, error) {
|
||||
ytdl, err := NewYtdl(downloadDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -22,6 +21,11 @@ func NewYtdlVideoSource(downloadDir string) (*YtdlVideoSource, error) {
|
|||
downloader: *ytdl,
|
||||
}
|
||||
|
||||
if config.YouTubeAPIKey != "" {
|
||||
ytapiEnricher := NewYouTubeAPIVideoEnricher(config.YouTubeAPIKey)
|
||||
source.enrichers = append(source.enrichers, ytapiEnricher)
|
||||
}
|
||||
|
||||
return &source, nil
|
||||
}
|
||||
|
||||
|
@ -36,6 +40,13 @@ func (s *YtdlVideoSource) GetVideo(id string) (*SourceVideo, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var bestThumbnail *ytdl.Thumbnail = nil
|
||||
for i, thumbnail := range metadata.Thumbnails {
|
||||
if i == 0 || bestThumbnail.Width < thumbnail.Width {
|
||||
bestThumbnail = &thumbnail
|
||||
}
|
||||
}
|
||||
|
||||
sourceVideo := SourceVideo {
|
||||
ID: id,
|
||||
Title: &metadata.Title,
|
||||
|
@ -43,11 +54,18 @@ func (s *YtdlVideoSource) GetVideo(id string) (*SourceVideo, error) {
|
|||
SourceURL: "\nhttps://www.youtube.com/watch?v=" + id,
|
||||
Languages: []string{},
|
||||
Tags: metadata.Tags,
|
||||
ReleaseTime: util.PtrToInt64(time.Now().Unix()),
|
||||
ThumbnailURL: nil,
|
||||
ReleaseTime: nil,
|
||||
ThumbnailURL: &bestThumbnail.URL,
|
||||
FullLocalPath: videoPath,
|
||||
}
|
||||
|
||||
for _, enricher := range s.enrichers {
|
||||
![]() this is an interesting design. what other enrichers did you envision? this is an interesting design. what other enrichers did you envision?
![]() This mainly came out of trying to accommodate easy switching between methods of getting release date and also allowing for fallback to multiple methods. The other methods in mind were things like the odysee API, multiple YouTube API keys, a future update to yt-dlp that might provide it, web scraping (although I don't think this would currently work as only the date is provided), or some 3rd party metadata provider. In the single video use-case, there could even be an enricher that just supplies values specified on the command line. The design here is meant to put together a list of enrichers based on command line options. The enrichers will then take turns trying fill-in the missing video metadata (although right now, it is only trying to fill-in release date) This mainly came out of trying to accommodate easy switching between methods of getting release date and also allowing for fallback to multiple methods. The other methods in mind were things like the odysee API, multiple YouTube API keys, a future update to yt-dlp that might provide it, web scraping (although I don't think this would currently work as only the date is provided), or some 3rd party metadata provider. In the single video use-case, there could even be an enricher that just supplies values specified on the command line.
The design here is meant to put together a list of enrichers based on command line options. The enrichers will then take turns trying fill-in the missing video metadata (although right now, it is only trying to fill-in release date)
![]() 👍 :+1:
|
||||
err = enricher.EnrichMissing(&sourceVideo)
|
||||
if err != nil {
|
||||
log.Warnf("Error enriching video %s, continuing enrichment: %v", id, err)
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("Source video retrieved via ytdl: %v", sourceVideo)
|
||||
|
||||
return &sourceVideo, nil
|
||||
|
|
i recommend os.ReadFile() to read the file in one go