Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix retrieve media files for D3C #613

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

norkans7
Copy link
Contributor

@norkans7 norkans7 commented Aug 16, 2023

Fix the way to retrieve files from D3C which need an extra step to first retrieve the URL of the file and replacing the the Facebook URL to retrieve the actual file from D3C

Comment on lines +393 to +400
req, _ := http.NewRequest(http.MethodGet, mediaURL, nil)
req.Header.Set("User-Agent", utils.HTTPUserAgent)
req.Header.Set(d3AuthorizationKey, token)

resp, respBody, err := handlers.RequestHTTP(req, clog)
if err != nil || resp.StatusCode/100 != 2 {
return "", fmt.Errorf("failed to request media URL for D3C channel: %s", err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #613 (aaa9f5e) into main (adb84e4) will decrease coverage by 0.04%.
The diff coverage is 55.00%.

@@            Coverage Diff             @@
##             main     #613      +/-   ##
==========================================
- Coverage   74.36%   74.33%   -0.04%     
==========================================
  Files          99       99              
  Lines       13347    13363      +16     
==========================================
+ Hits         9926     9933       +7     
- Misses       2705     2711       +6     
- Partials      716      719       +3     
Files Changed Coverage Δ
handlers/dialog360/dialog360.go 80.07% <55.00%> (-1.18%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rowanseymour rowanseymour merged commit 8420072 into main Aug 16, 2023
5 of 7 checks passed
@rowanseymour rowanseymour deleted the fix-d3c-retrieve-media branch August 16, 2023 13:51
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants