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

Commit 3c3cede

Browse files
committed
🐛 Moved Accept-Language to extractor
1 parent 334fc36 commit 3c3cede

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/channel.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ impl Downloader for DownloaderExample {
2020
let resp = self
2121
.0
2222
.get(url)
23-
.header("Accept-Language", "en")
2423
.send()
2524
.await
2625
.map_err(|er| ParsingError::DownloadError {
@@ -50,7 +49,7 @@ impl Downloader for DownloaderExample {
5049
header.1.parse().unwrap(),
5150
);
5251
}
53-
let res = res.headers(headers).header("Accept-Language", "en");
52+
let res = res.headers(headers);
5453
let res = res.send().await.map_err(|er| er.to_string())?;
5554
let body = res.text().await.map_err(|er| er.to_string())?;
5655
Ok(String::from(body))

src/youtube_extractor/channel_extractor.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ impl<D: Downloader> YTChannelExtractor<D> {
3030
"X-YouTube-Client-Version".to_string(),
3131
HARDCODED_CLIENT_VERSION.to_string(),
3232
);
33+
headers.insert("Accept-Language".to_string(), "en".to_string());
3334
let response = downloader.download_with_header(&url, headers).await?;
3435
let json_response = serde_json::from_str::<Value>(&response)
3536
.map_err(|e| ParsingError::from(e.to_string()))?;

0 commit comments

Comments
 (0)