Skip to content

Instantly share code, notes, and snippets.

@MostafaRabia
Last active August 29, 2017 21:47
Show Gist options
  • Save MostafaRabia/e398e424bc0a31aaec88bf0490576cb7 to your computer and use it in GitHub Desktop.
Save MostafaRabia/e398e424bc0a31aaec88bf0490576cb7 to your computer and use it in GitHub Desktop.
$(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