From 16593437dcca1f44f11aecae80006ce3309d1d19 Mon Sep 17 00:00:00 2001 From: Tufayel Ahmed <39314838+TufayelLUS@users.noreply.github.com> Date: Mon, 28 Sep 2020 14:51:10 +0600 Subject: [PATCH] Fixed username problem and added upload date The username wasn't printing properly due to a change in source code. It has been fixed and added the upload time of the video as additional feature. --- index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 0d10146..f378012 100644 --- a/index.php +++ b/index.php @@ -131,7 +131,10 @@ function getContent($url, $geturl = false) if (count($check) > 1){ $contentURL = explode("\"",$check[1])[0]; $thumb = explode("\"",explode('og:image" content="', $resp)[1])[0]; - $username = explode("/",explode("@",explode("\"",explode("\"canonicalHref\":\"", $resp)[1])[0])[1])[0]; + $username = explode('/',explode('"$pageUrl":"/@', $resp)[1])[0]; + $create_time = explode('"', explode('"createTime":"', $resp)[1])[0]; + $dt = new DateTime("@$create_time"); + $create_time = $dt->format("d M Y H:i:s A"); $videoKey = getKey($contentURL); $cleanVideo = "https://api2-16-h2.musical.ly/aweme/v1/play/?video_id=$videoKey&vr_type=0&is_play_url=1&source=PackSourceEnum_PUBLISH&media_type=4"; $cleanVideo = getContent($cleanVideo, true); @@ -150,6 +153,7 @@ function getContent($url, $geturl = false)