Skip to content

Commit

Permalink
added debug log to check video call
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishjh-bst committed Sep 30, 2023
1 parent 53965bf commit 700f3f5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
2 changes: 2 additions & 0 deletions youtube/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ type ytChannelID interface {
type videoID string

func (v videoID) getChannelList(p *Plugin, list *youtube.ChannelsListCall) (cResp *youtube.ChannelListResponse, err error) {

videoListCall := p.YTService.Videos.List(listParts)
vResp, err := videoListCall.Id(string(v)).MaxResults(1).Do()
if err != nil {
Expand Down Expand Up @@ -522,6 +523,7 @@ func (p *Plugin) MaybeAddChannelWatch(lock bool, channel string) error {
}

func (p *Plugin) CheckVideo(videoID string, channelID string) error {
logger.Debugf("Checking video request with videoID %s and channelID %s ", videoID, channelID)
subs, err := p.getRemoveSubs(channelID)
if err != nil || len(subs) < 1 {
return err
Expand Down
4 changes: 2 additions & 2 deletions youtube/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (p *Plugin) InitWeb() {
web.CPMux.Handle(pat.New("/youtube/*"), ytMux)
web.CPMux.Handle(pat.New("/youtube"), ytMux)

// Alll handlers here require guild channels present
// All handlers here require guild channels present
ytMux.Use(web.RequireBotMemberMW)
ytMux.Use(web.RequirePermMW(discordgo.PermissionMentionEveryone))

Expand Down Expand Up @@ -295,7 +295,7 @@ func (p *Plugin) HandleFeedUpdate(w http.ResponseWriter, r *http.Request) {
return
}

// Handle new/udpated video
// Handle new/updated video
defer r.Body.Close()
bodyReader := io.LimitReader(r.Body, 0xffff1)

Expand Down
14 changes: 0 additions & 14 deletions youtube/youtube.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ func (p *Plugin) DisableGuildFeeds(guildID int64) error {
}

func (p *Plugin) WebSubSubscribe(ytChannelID string) error {
// hub.callback:https://testing.yagpdb.xyz/yt_new_upload
// hub.topic:https://www.youtube.com/xml/feeds/videos.xml?channel_id=UCt-ERbX-2yA6cAqfdKOlUwQ
// hub.verify:sync
// hub.mode:subscribe
// hub.verify_token:hmmmmmmmmwhatsthis
// hub.secret:
// hub.lease_seconds:

values := url.Values{
"hub.callback": {"https://" + common.ConfHost.GetString() + "/yt_new_upload/" + confWebsubVerifytoken.GetString()},
Expand Down Expand Up @@ -147,13 +140,6 @@ func (p *Plugin) WebSubSubscribe(ytChannelID string) error {
}

func (p *Plugin) WebSubUnsubscribe(ytChannelID string) error {
// hub.callback:https://testing.yagpdb.xyz/yt_new_upload
// hub.topic:https://www.youtube.com/xml/feeds/videos.xml?channel_id=UCt-ERbX-2yA6cAqfdKOlUwQ
// hub.verify:sync
// hub.mode:subscribe
// hub.verify_token:hmmmmmmmmwhatsthis
// hub.secret:
// hub.lease_seconds:

values := url.Values{
"hub.callback": {"https://" + common.ConfHost.GetString() + "/yt_new_upload/" + confWebsubVerifytoken.GetString()},
Expand Down

0 comments on commit 700f3f5

Please sign in to comment.