Last active
August 29, 2017 21:47
-
-
Save MostafaRabia/e398e424bc0a31aaec88bf0490576cb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){$("#mc2").on("click",function(){$(this).attr("attr",1),$("#mc").attr("attr",0),$(".videoUrl").hide(),$("form").prepend("<textarea class='videoUrl' placeholder='رابط الفيديو'></textarea>")}),$("#mc").on("click",function(){$(this).attr("attr",1),$("#mc2").attr("attr",0),$(".videoUrl").hide(),$("form").prepend('<input type="text" placeholder="رابط الفيديو" class="videoUrl">')}),$(".submit").on("click",function(){var r=$("#mc").attr("attr"),t=$("#mc2").attr("attr"),e=$(".videoUrl").val();return $(".error-msg").hide(),$(".sub-download").hide(),$(".progress").show(),""==e?($(".progress").hide(),alert("يجب وضع رابط الفيديو")):null==r&&null==t?($(".progress").hide(),alert("اختار نوع الفيديو")):1==r?$.ajax({type:"POST",dataType:"json",url:"http://mostafa456713594.byethost7.com/main.php",data:{url:e},success:function(r){if("success"==r.type){$(".error-msg").hide(),$(".progress").hide(),$(".sub-download").show();var t=e.split("/")[5];$(".info span").html(r.title),$(".picture img").attr("src","https://graph.facebook.com/"+t+"/picture"),$(".SD").attr("href",r.sd_download_url),r.hd_download_url?$(".HD").attr("href",r.hd_download_url):$(".HD").hide()}else(r.type="failure")&&($(".progress").hide(),$(".error-msg").show())}}):1==t&&$.ajax({type:"POST",dataType:"json",url:"http://mostafa456713594.byethost7.com/private.php",data:{url:e},success:function(r){"success"==r.type?($(".error-msg").hide(),$(".progress").hide(),$(".sub-download").show(),$(".info span").html(r.title),$(".picture img").attr("src",r.img[0]),$(".SD").attr("href",r.sd_download_url),r.hd_download_url?$(".HD").attr("href",r.hd_download_url):$(".HD").hide()):(r.type="failure")&&($(".progress").hide(),$(".error-msg").show())}}),!1})}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment