Use new Localization and Downloader implementations from extractor

This commit is contained in:
Mauricio Colli 2019-10-27 23:35:51 -03:00
parent 577bfab366
commit 71f1bbdcc1
No known key found for this signature in database
GPG key ID: F200BFD6F29DDD85
20 changed files with 260 additions and 394 deletions

View file

@ -5,7 +5,7 @@ import android.util.Log;
import androidx.annotation.Nullable;
import org.schabi.newpipe.Downloader;
import org.schabi.newpipe.DownloaderImpl;
import java.io.File;
import java.io.FileNotFoundException;
@ -212,7 +212,7 @@ public class DownloadMission extends Mission {
HttpURLConnection openConnection(String url, int threadId, long rangeStart, long rangeEnd) throws IOException {
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setInstanceFollowRedirects(true);
conn.setRequestProperty("User-Agent", Downloader.USER_AGENT);
conn.setRequestProperty("User-Agent", DownloaderImpl.USER_AGENT);
conn.setRequestProperty("Accept", "*/*");
// BUG workaround: switching between networks can freeze the download forever