Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
adjust channel info logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nikooo777 committed Mar 21, 2024
1 parent c82760c commit 7806d42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions manager/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ func (s *Sync) ensureChannelOwnership() error {
return errors.Err("the database has a channel recorded (%s) but nothing was found in our control", s.DbChannelData.ChannelClaimID)
}

if s.DbChannelData.IsDeletedOnYoutube || s.DbChannelData.TransferState == shared.TransferStateComplete {
return nil
}
channelUsesOldMetadata := false
if channelToUse != nil {
channelUsesOldMetadata = channelToUse.Value.GetThumbnail() == nil || (len(channelToUse.Value.GetLanguages()) == 0 && s.DbChannelData.Language != "")
Expand All @@ -410,10 +413,6 @@ func (s *Sync) ensureChannelOwnership() error {
}
}

if s.DbChannelData.IsDeletedOnYoutube {
return nil
}

balanceResp, err := s.daemon.AccountBalance(nil)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion ytapi/ytapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func ChannelInfo(channelID string, attemptNo int, ipPool *ip_manager.IPPool) (*Y
// get end index by matching pattern AFTER the start index
dataEndIndex := strings.Index(pageBody[dataStartIndex:], ";</script>") + dataStartIndex
//dataEndIndex := strings.Index(pageBody, "}]}}};</script>") + 5
if dataEndIndex == dataStartIndex {
if dataEndIndex <= dataStartIndex {
return nil, errors.Err("start index is lower than end index. cannot extract channel info!")
}
data := pageBody[dataStartIndex:dataEndIndex]
Expand Down

0 comments on commit 7806d42

Please sign in to comment.