Skip to content

Commit f17f7b9

Browse files
committed
Apply requested changes in YoutubeParsingHelper
1 parent 301b9fa commit f17f7b9

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,7 @@ public static String getAndroidUserAgent(@Nullable final Localization localizati
12641264
// Spoofing an Android 12 device with the hardcoded version of the Android app
12651265
return "com.google.android.youtube/" + MOBILE_YOUTUBE_CLIENT_VERSION
12661266
+ " (Linux; U; Android 12; "
1267-
+ (localization == null ? Localization.DEFAULT.getCountryCode()
1268-
: localization.getCountryCode())
1267+
+ (localization != null ? localization : Localization.DEFAULT).getCountryCode()
12691268
+ ") gzip";
12701269
}
12711270

@@ -1284,10 +1283,8 @@ public static String getAndroidUserAgent(@Nullable final Localization localizati
12841283
public static String getIosUserAgent(@Nullable final Localization localization) {
12851284
// Spoofing an iPhone running iOS 15.4 with the hardcoded mobile client version
12861285
return "com.google.ios.youtube/" + MOBILE_YOUTUBE_CLIENT_VERSION
1287-
+ "(" + IOS_DEVICE_MODEL
1288-
+ "; U; CPU iOS 15_4 like Mac OS X; "
1289-
+ (localization != null ? localization.getCountryCode()
1290-
: Localization.DEFAULT.getCountryCode())
1286+
+ "(" + IOS_DEVICE_MODEL + "; U; CPU iOS 15_4 like Mac OS X; "
1287+
+ (localization != null ? localization : Localization.DEFAULT).getCountryCode()
12911288
+ ")";
12921289
}
12931290

0 commit comments

Comments
 (0)