public final class YoutubeJavaScriptExtractor extends Object
This class handling fetching the JavaScript file in order to allow other classes to extract the needed functions.
Modifier and Type | Method and Description |
---|---|
static String |
extractJavaScriptCode()
Same as
extractJavaScriptCode(String) but with a constant
value for videoId. |
static String |
extractJavaScriptCode(String videoId)
Extracts the JavaScript file.
|
static String |
extractJavaScriptUrl() |
static String |
extractJavaScriptUrl(String videoId) |
static void |
resetJavaScriptCode()
Reset the JavaScript code.
|
@Nonnull public static String extractJavaScriptCode(String videoId) throws ParsingException
videoId
- Does not influence the result, but a valid video id may help in the chance
that YouTube tracks it.ParsingException
- If the extraction failed.@Nonnull public static String extractJavaScriptCode() throws ParsingException
extractJavaScriptCode(String)
but with a constant
value for videoId.
Possible because the videoId has no influence on the result.
In the off chance that YouTube tracks with which video id the request is made, it may make sense to pass in video ids.
ParsingException
public static void resetJavaScriptCode()
extractJavaScriptCode()
or extractJavaScriptCode(String)
is called.public static String extractJavaScriptUrl() throws ParsingException
ParsingException
public static String extractJavaScriptUrl(String videoId) throws ParsingException
ParsingException