This repository was archived by the owner on Nov 2, 2021. It is now read-only.
Commit 3c3cede 1 parent 334fc36 commit 3c3cede Copy full SHA for 3c3cede
File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ impl Downloader for DownloaderExample {
20
20
let resp = self
21
21
. 0
22
22
. get ( url)
23
- . header ( "Accept-Language" , "en" )
24
23
. send ( )
25
24
. await
26
25
. map_err ( |er| ParsingError :: DownloadError {
@@ -50,7 +49,7 @@ impl Downloader for DownloaderExample {
50
49
header. 1 . parse ( ) . unwrap ( ) ,
51
50
) ;
52
51
}
53
- let res = res. headers ( headers) . header ( "Accept-Language" , "en" ) ;
52
+ let res = res. headers ( headers) ;
54
53
let res = res. send ( ) . await . map_err ( |er| er. to_string ( ) ) ?;
55
54
let body = res. text ( ) . await . map_err ( |er| er. to_string ( ) ) ?;
56
55
Ok ( String :: from ( body) )
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ impl<D: Downloader> YTChannelExtractor<D> {
30
30
"X-YouTube-Client-Version" . to_string ( ) ,
31
31
HARDCODED_CLIENT_VERSION . to_string ( ) ,
32
32
) ;
33
+ headers. insert ( "Accept-Language" . to_string ( ) , "en" . to_string ( ) ) ;
33
34
let response = downloader. download_with_header ( & url, headers) . await ?;
34
35
let json_response = serde_json:: from_str :: < Value > ( & response)
35
36
. map_err ( |e| ParsingError :: from ( e. to_string ( ) ) ) ?;
You can’t perform that action at this time.
0 commit comments