Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Udhayarajan committed Jul 24, 2023
1 parent 68bd438 commit 964f2e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/commonMain/kotlin/com/mugames/vidsnapkit/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class Util {
*/
fun decodeHTML(text: String?): String? {
if (text == null) return null
var data = text.replace("%(?![0-9a-fA-F]{2})".toRegex(), "%25");
data = data.replace("\\+".toRegex(), "%2B");
var data = text.replace("%(?![0-9a-fA-F]{2})".toRegex(), "%25")
data = data.replace("\\+".toRegex(), "%2B")
val decoder = HtmlDecoderFactory.createDecoderFactory()
val decoded = decoder.decodeHtml(data)
// decoded = HtmlCompat.fromHtml(text, HtmlCompat.FROM_HTML_MODE_LEGACY).toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,22 @@ abstract class Extractor(
private fun getRandomInstagramUserAgent(): String {
val userAgents = listOf(
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 " +
"Safari/537.36",
"Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 " +
"Safari/537.36",
"Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) " +
"Chrome/74.0.3729.169 Safari/537.36",
"Chrome/74.0.3729.169 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 " +
"Safari/537.36",
"Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 " +
"Safari/537.36",
"Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 " +
"Safari/537.36",
"Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 " +
"Safari/537.36",
"Safari/537.36",
"Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) " +
"Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; " +
"828x1792; 165586599)"
"Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; " +
"828x1792; 165586599)"
)
return userAgents.random()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ class Facebook internal constructor(url: String) : Extractor(url) {
videoData.get("original_width")
.toString() + "x" + videoData.get("original_height") + "(" + s.uppercase() + ")",

)
)
)
}
return SUCCESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ class Instagram internal constructor(url: String) : Extractor(url) {
private suspend fun extractMusicAssetInfo(assetInfo: JSONObject) {
formats.title =
assetInfo.getNullableString("title")?.ifEmpty { null } ?: assetInfo.getNullableString("subtitle")
?.ifEmpty { null } ?: "Reels_audio ${assetInfo.getNullableString("display_artist")}"
?.ifEmpty { null } ?: "Reels_audio ${assetInfo.getNullableString("display_artist")}"
val imageUrl = assetInfo.run {
getNullableString("cover_artwork_uri")?.ifEmpty { null } ?: getNullableString("cover_artwork_thumbnail_uri")
?: getJSONObject("music_composition_info").getString("placeholder_profile_pic_url")
?: getJSONObject("music_composition_info").getString("placeholder_profile_pic_url")
}
formats.imageData.add(ImageResource(imageUrl, Util.getResolutionFromUrl(imageUrl)))

Expand Down

0 comments on commit 964f2e8

Please sign in to comment.