Php ile instagram video indirici nasıl yapılır? Turkish Tutorial

in #utopian-io7 years ago (edited)

## ENGLISH

Hello guys my name is Sinan Karayaman. I have been working on wordpress and other web services for few years now.Now lets begin how to create instagram video indirici step by step.

  • How to create instagram video indirici?

## TÜRKÇE

Merhaba arkadaşlar ben Sinan Karayaman.Bugün sizlere php ile instagram video indirici nasıl oluşturulur onu anlatacağım.

<?php
/*
Sinan Karayaman
*/
    require('Fonksiyonlar.php');
?>

<!DOCTYPE html>
<html>
<head>
    <title>instagram video downloader</title>
    <style type="text/css">
        
        *{
            font-family: arial;
        }
    </style>
</head>
<body>

<div>
    
    <center><h2>Instagram Video Downloader</h2></center>

    <form action="" method="POST" style="width: 500px; margin: auto;">
            
        <input type="text" name="VideoUrl" style="padding: 10px; width: 450px; border-radius: 3px; border: 1px solid #ddd;" placeholder="Video URL" /><br />
        <input type="submit" value="Save Video" style="padding: 10px; width: 470px; border-radius: 3px; border: 1px solid #ddd; background-color: #f6f6f6; margin-top: 10px;" />

    </form>

</div>

<?php
    
    if(isset($_POST['VideoUrl'])){
        $Url = $_POST['VideoUrl'];
        $Source = Connect($Url);
        $Video = preg_match('@video" content="(.*?)"@', $Source, $Video)?end($Video):false;
        if($Video){
            $VideoName = 'videos/'.uniqid().'.mp4';
            $VideoSource = Connect($Video);
            if(file_put_contents($VideoName, $VideoSource)){
                echo '<center><h2>Video Saved</h2></center>';
                echo '<center><video width="500" controls>
                      <source src="'.$VideoName.'" type="video/mp4">
                    </video></center>';
    
            }
        }else{
            echo '<center><h2>Video Not Found or Private</h2></center>';
        }
    }
?>

</body>
</html> 

Html form etiketiyle video url bilgisini çekip, aynı sayfa içerisine post ediyoruz.Methodu isterseniz get olarakta yollayabilirsiniz, bu tamamen sizin tercihinize kalmış.Ben postu tercih ettim.

1.png

Kendimize bağlantı için bir curl fonksiyonu oluşturuyoruz, bu kısımda isterseniz 'file_get_contents' fonksiyonunu kullanabilirsiniz.Bizim curl fonksiyonunu tercih etme sebebimiz 'file_get_contents' e göre daha seri ve daha fonksiyonel olmasıdır.

fonksiyonlar.png

*36. satırda kullandığımız isset fonksiyonu ile post edilip edilmediğini kontrol ediyoruz.Eğer post edildiyse 'true' post edilmediyse 'false' olarak değer döndürür.
*38. satırda kullandığımız 'Connect' fonksiyonumuz ile post ile gelen urlye bağlanıp gelen değeri '$Source' değişkenine atıyoruz.
*39. satırda kullandığımız 'preg_match' fonksiyonu ile kaynak kodda bulunan mp4 adresini alıyoruz ve video değişkenine atıyoruz.
*40. satırda eğer video urlsi bulunduysa işleme devam ediyor, eğer video url bulunmadıysa 50. satırda bulunan 'else' bloğuna düşer.
*41. satırda 'uniqid' ile video adı oluşturuyoruz.
*42. satırda ise 39. satırdan aldığımız videonun kaynağını alıyoruz.
*43. satırda kullandığımız 'file_put_contents' fonksiyonu ile aldığımız kaynağı klasöre indiriyoruz.
*44. 45. 46. 47. satırda sonuçları 'echo' ile ekrana basıyoruz.

2.png

Yazdığımız instagram video indirici ekran görüntüsü :

sonuç.png

GitHub Linki : https://github.com/php/php-src

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @sinankarayaman I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.029
BTC 58720.84
ETH 3088.52
USDT 1.00
SBD 2.41