Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
🐛 Moved Accept-Language to extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmiddiii committed Sep 22, 2021
1 parent 334fc36 commit 3c3cede
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ impl Downloader for DownloaderExample {
let resp = self
.0
.get(url)
.header("Accept-Language", "en")
.send()
.await
.map_err(|er| ParsingError::DownloadError {
Expand Down Expand Up @@ -50,7 +49,7 @@ impl Downloader for DownloaderExample {
header.1.parse().unwrap(),
);
}
let res = res.headers(headers).header("Accept-Language", "en");
let res = res.headers(headers);
let res = res.send().await.map_err(|er| er.to_string())?;
let body = res.text().await.map_err(|er| er.to_string())?;
Ok(String::from(body))
Expand Down
1 change: 1 addition & 0 deletions src/youtube_extractor/channel_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl<D: Downloader> YTChannelExtractor<D> {
"X-YouTube-Client-Version".to_string(),
HARDCODED_CLIENT_VERSION.to_string(),
);
headers.insert("Accept-Language".to_string(), "en".to_string());
let response = downloader.download_with_header(&url, headers).await?;
let json_response = serde_json::from_str::<Value>(&response)
.map_err(|e| ParsingError::from(e.to_string()))?;
Expand Down

0 comments on commit 3c3cede

Please sign in to comment.