sealedtx / java-youtube-downloader

Simple, almost zero-dependency java parser for retrieving youtube video metadata
Other
413 stars 115 forks source link

get a "Could not find player config on web page" exception when I setup a http proxy to run com.github.kiulian.downloader.YoutubeDownloadSpeed_Tests#downloadSpeed_Success #85

Closed hk200 closed 3 years ago

hk200 commented 3 years ago

I modified init code following the sample code:

@BeforeEach
    void initDownloader() {
//        final Config config = Config.buildDefault();
        final Config config = new Config.Builder()
//                .maxRetries(1) // retry on failure, default 0
//                .header("Accept-language", "en-US,en;") // extra request header
                .proxy("127.0.0.1", 10081)
                .build();
        this.downloader = new DownloaderImpl(config);
        this.youtubeDownloader = new YoutubeDownloader(config, downloader);
        if (!outDir.isDirectory()) {
            outDir.mkdirs();
        }
    }

and get a "com.github.kiulian.downloader.YoutubeException$BadPageException: Could not find player config on web page" excpetion when debug

this proxy host and port setting is worked.

how can I fix this issue?

sealedtx commented 3 years ago

@hk200 Hi, please, provide videoId you are trying to download. If you are debugging from sources you may log and provide html webpage retrieved from youtube here in code https://github.com/sealedtx/java-youtube-downloader/blob/930a237cebd1d97925780494255e7c256c7af1a7/src/main/java/com/github/kiulian/downloader/extractor/ExtractorImpl.java#L62

hk200 commented 3 years ago

@hk200 Hi, please, provide videoId you are trying to download. If you are debugging from sources you may log and provide html webpage retrieved from youtube here in code https://github.com/sealedtx/java-youtube-downloader/blob/930a237cebd1d97925780494255e7c256c7af1a7/src/main/java/com/github/kiulian/downloader/extractor/ExtractorImpl.java#L62

I am using the default url video at the sample tester, the video id is: private static final String ZOOM_OUT_ID = "DgqAAE9Aagc"; the url is " https://www.youtube.com/watch?v=DgqAAE9Aagc" I am trying retrieve more debug info from ExtractorImpl class.

hk200 commented 3 years ago

the page retrieved from remote site seems corrent, attached.

sample2.txt

sealedtx commented 3 years ago

@hk200 check last commit, it should fix your problem

hk200 commented 3 years ago

@hk200 check last commit, it should fix your problem

I check it out and try again.

hk200 commented 3 years ago

@hk200 check last commit, it should fix your problem

I get the normal output of the speed tester: Straight.................................................................................................... 12207ms By part .................................................................................................... 34598ms Straight download is 2.83 faster for format 18 Straight.................................................................................................... 72275ms By part .................................................................................................... 12758ms Download by part is 5.67 faster for format 135

seems everything ok of this issue fix testing

Many thanks and Best Regards

sealedtx commented 3 years ago

@hk200 thank you, 3.0.1 release is drafted