diff --git a/config.example.yaml b/config.yaml similarity index 83% rename from config.example.yaml rename to config.yaml index 7a352c8..2558dce 100644 --- a/config.example.yaml +++ b/config.yaml @@ -6,4 +6,4 @@ reddit: youtube: instance: https://example.com - disabled: true \ No newline at end of file + disabled: true diff --git a/docker-compose.yaml b/docker-compose.yaml index c8764fe..7b17ab0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -10,6 +10,7 @@ services: volumes: - ./config.yaml:/app/config.yaml - ./cookies:/app/cookies + - ./downloads:/app/downloads depends_on: db: condition: service_healthy diff --git a/ext/youtube/util.go b/ext/youtube/util.go index 71393c3..dbf3a3e 100644 --- a/ext/youtube/util.go +++ b/ext/youtube/util.go @@ -14,11 +14,16 @@ const invEndpoint = "/api/v1/videos/" var invInstance string + func ParseInvFormats(data *InvResponse) []*models.MediaFormat { - formats := make([]*models.MediaFormat, 0, len(data.AdaptiveFormats)) + // Decided to use FormatStream instead of AdaptiveFormats since this latter might not be available in some videos. + //formats := make([]*models.MediaFormat, 0, len(data.AdaptiveFormats)) + formats := make([]*models.MediaFormat, 0, len(data.FormatStreams)) duration := data.LengthSeconds - - for _, format := range data.AdaptiveFormats { + + // As explained above, using FormatStreams + //for _, format := range data.AdaptiveFormats { + for _, format := range data.FormatStreams { if format.URL == "" { continue }