Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
More recent UserAgent (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
lubo-fr committed Feb 10, 2022
1 parent 09716d0 commit c9044ef
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -57,7 +57,7 @@ public abstract class YouTubeExtractor extends AsyncTask<String, Void, SparseArr
private final Lock lock = new ReentrantLock();
private final Condition jsExecuting = lock.newCondition();

private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36";
private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.98 Safari/537.36";

private static final Pattern patYouTubePageLink = Pattern.compile("(http|https)://(www\\.|m.|)youtube\\.com/watch\\?v=(.+?)( |\\z|&)");
private static final Pattern patYouTubeShortLink = Pattern.compile("(http|https)://(www\\.|)youtu.be/(.+?)( |\\z|&)");
Expand Down

2 comments on commit c9044ef

@candratop3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still error sir:

E/YouTubeExtractor: Extraction failed
org.json.JSONException: No value for streamingData
at org.json.JSONObject.get(JSONObject.java:389)
at org.json.JSONObject.getJSONObject(JSONObject.java:609)
at at.huber.youtubeExtractor.YouTubeExtractor.getStreamUrls(YouTubeExtractor.java:231)
at at.huber.youtubeExtractor.YouTubeExtractor.doInBackground(YouTubeExtractor.java:190)
at at.huber.youtubeExtractor.YouTubeExtractor.doInBackground(YouTubeExtractor.java:40)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

@lubo-fr
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error corrected is "ytPlayerResponse was not found", not "Extraction failed" which seems related to a wrong or private video id.

Please sign in to comment.