@@ -279,12 +279,12 @@ public long getLength() throws ParsingException {
279279 return Long .parseLong (duration );
280280 } catch (final Exception e ) {
281281 if (desktopStreamingData != null ) {
282- final JsonArray adaptiveFormats = desktopStreamingData .getArray ("adaptiveFormats" );
282+ final JsonArray adaptiveFormats = desktopStreamingData .getArray (ADAPTIVE_FORMATS );
283283 final String durationMs = adaptiveFormats .getObject (0 )
284284 .getString ("approxDurationMs" );
285285 return Math .round (Long .parseLong (durationMs ) / 1000f );
286286 } else if (mobileStreamingData != null ) {
287- final JsonArray adaptiveFormats = mobileStreamingData .getArray ("adaptiveFormats" );
287+ final JsonArray adaptiveFormats = mobileStreamingData .getArray (ADAPTIVE_FORMATS );
288288 final String durationMs = adaptiveFormats .getObject (0 )
289289 .getString ("approxDurationMs" );
290290 return Math .round (Long .parseLong (durationMs ) / 1000f );
@@ -685,9 +685,11 @@ public String getErrorMessage() {
685685 private static final String DEOBFUSCATION_FUNC_NAME = "deobfuscate" ;
686686
687687 private static final String [] REGEXES = {
688- "(?:\\ b|[^a-zA-Z0-9$])([a-zA-Z0-9$]{2})\\ s*=\\ s*function\\ (\\ s*a\\ s*\\ )\\ s*\\ {\\ s*a\\ s*=\\ s*a\\ .split\\ (\\ s*\" \" \\ s*\\ )" ,
688+ "(?:\\ b|[^a-zA-Z0-9$])([a-zA-Z0-9$]{2,})\\ s*=\\ s*function\\ (\\ s*a\\ s*\\ )\\ s*\\ {\\ s*a\\ s*=\\ s*a\\ .split\\ (\\ s*\" \" \\ s*\\ )" ,
689+ "\\ bm=([a-zA-Z0-9$]{2,})\\ (decodeURIComponent\\ (h\\ .s\\ )\\ )" ,
690+ "\\ bc&&\\ (c=([a-zA-Z0-9$]{2,})\\ (decodeURIComponent\\ (c\\ )\\ )" ,
689691 "([\\ w$]+)\\ s*=\\ s*function\\ ((\\ w+)\\ )\\ {\\ s*\\ 2=\\ s*\\ 2\\ .split\\ (\" \" \\ )\\ s*;" ,
690- "\\ b([\\ w$]{2})\\ s*=\\ s*function\\ ((\\ w+)\\ )\\ {\\ s*\\ 2=\\ s*\\ 2\\ .split\\ (\" \" \\ )\\ s*;" ,
692+ "\\ b([\\ w$]{2, })\\ s*=\\ s*function\\ ((\\ w+)\\ )\\ {\\ s*\\ 2=\\ s*\\ 2\\ .split\\ (\" \" \\ )\\ s*;" ,
691693 "\\ bc\\ s*&&\\ s*d\\ .set\\ ([^,]+\\ s*,\\ s*(:encodeURIComponent\\ s*\\ ()([a-zA-Z0-9$]+)\\ ("
692694 };
693695 private static final String STS_REGEX = "signatureTimestamp[=:](\\ d+)" ;
@@ -931,8 +933,8 @@ private void storePlayerJs() throws ParsingException {
931933
932934 private boolean isCipherProtectedContent () {
933935 if (desktopStreamingData != null ) {
934- if (desktopStreamingData .has ("adaptiveFormats" )) {
935- final JsonArray adaptiveFormats = desktopStreamingData .getArray ("adaptiveFormats" );
936+ if (desktopStreamingData .has (ADAPTIVE_FORMATS )) {
937+ final JsonArray adaptiveFormats = desktopStreamingData .getArray (ADAPTIVE_FORMATS );
936938 if (!isNullOrEmpty (adaptiveFormats )) {
937939 for (final Object adaptiveFormat : adaptiveFormats ) {
938940 final JsonObject adaptiveFormatJsonObject = ((JsonObject ) adaptiveFormat );
@@ -943,8 +945,8 @@ private boolean isCipherProtectedContent() {
943945 }
944946 }
945947 }
946- if (desktopStreamingData .has ("formats" )) {
947- final JsonArray formats = desktopStreamingData .getArray ("formats" );
948+ if (desktopStreamingData .has (FORMATS )) {
949+ final JsonArray formats = desktopStreamingData .getArray (FORMATS );
948950 if (!isNullOrEmpty (formats )) {
949951 for (final Object format : formats ) {
950952 final JsonObject formatJsonObject = ((JsonObject ) format );
0 commit comments