Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Instagram Image Downloader - Commented Source Code // Learning Purposes Tool

Will soon update this into ASP.Net, so it's easier to use.

We all know Instagram doesn't let us download the images without having to go into Inspect Element or some sort of Add-on, so here's a simple software that does the trick for you (:

Video

Will soon make a mass download feature, which allows you to download the whole Instagram profile images!


Source: Pastebin Link

Please leave a post!

Hope you like this!
Coder looking for partner with good ideas


PM me.

I think the source code would be more useful than the executable. Post it on pastebin pls with vb.net syntax highlighting. Thanks babe
(Jan 11, 2015 09:20 AM)+Haze Wrote:  I think the source code would be more useful than the executable. Post it on pastebin pls with vb.net syntax highlighting. Thanks babe

Updated it with the PB link. Hope more people leave the post duh...
Coder looking for partner with good ideas


PM me.

lol @ creating controls just to hold a string.
you should of just made this whole project into a function.

function GetImage(link as string) as image
ect...
I'm agree with "nathan72389" you could do it with the function and returning the the image
anyway thanks for sharing it is usefull
[Image: narwinsig.gif]
Honestly mate, it takes less time and effort to use Inspect Element:

[Image: 6SCSSkB.gif]

No problem doing this for academic purposes though!

Just so this post isn't totally useless: if you do end up creating a website for this, you needn't bother with a server-side technology - just do it on the client-side using JS.
OP don't take this as me being an ass, I want to help you learn something different.
To extend of what Nathan said. You could use a function to get the image url of your instagram URL. And you could use a regex pattern to get the download URL of the URL instead of using that GetBetween which I don't quiet understand.

You can created a shared class. I'm gonna name mine InstagramHelper.vb

Code
Imports System.Net
Imports System.Text.RegularExpressions
Public Class InstagramHelper

    Private Shared Regex As Regex

    Public Shared Function GetImageURL(imgURL As String) As String

      Using wc As New WebClient
      Dim src As String = wc.DownloadString(imgURL)

      Regex = New Regex("http://(.*).jpg")
      Dim match As Match = Regex.Match(src)

      Return match.Groups(0).Value.ToString()
      End Using

    End Function
End Class

You can then call it like.
PHP Code

<?php 
Dim imgURL 
As String = InstagramHelper.GetImageURL("http://instagram.com/p/xPgjyMgUdN/?modal=true")
PictureBox1.Image = New Bitmap(New MemoryStream(New WebClient().DownloadData(imgURL))) 

But like ByteBlast said, it's easier to inspect element. But I guess this could be good for learning purposes.
(Jan 11, 2015 10:32 AM)+Bourbon Wrote:  Honestly mate, it takes less time and effort to use Inspect Element:

https://i.imgur.com/6SCSSkB.gif

No problem doing this for academic purposes though!

Just so this post isn't totally useless: if you do end up creating a website for this, you needn't bother with a server-side technology - just do it on the client-side using JS.

😊 do u think b4 u reply dont think u do it this time


(Jan 11, 2015 10:45 AM)+Haze Wrote:  OP don't take this as me being an ass, I want to help you learn something different.
To extend of what Nathan said. You could use a function to get the image url of your instagram URL. And you could use a regex pattern to get the download URL of the URL instead of using that GetBetween which I don't quiet understand.

You can created a shared class. I'm gonna name mine InstagramHelper.vb

Code
...

You can then call it like.
PHP Code

<?php 
Dim imgURL 
As String = InstagramHelper.GetImageURL("http://instagram.com/p/xPgjyMgUdN/?modal=true")
PictureBox1.Image = New Bitmap(New MemoryStream(New WebClient().DownloadData(imgURL))) 

But like ByteBlast said, it's easier to inspect element. But I guess this could be good for learning purposes.

why u need class for something like this ?
and what if u need to do it with 100 images 😊
Is every image on instagram a jpeg file?
[Image: vjPWhyy.gif]
(Jan 11, 2015 10:45 AM)+Haze Wrote:  OP don't take this as me being an ass, I want to help you learn something different.
To extend of what Nathan said. You could use a function to get the image url of your instagram URL. And you could use a regex pattern to get the download URL of the URL instead of using that GetBetween which I don't quiet understand.

You can created a shared class. I'm gonna name mine InstagramHelper.vb

Code
Imports System.Net
Imports System.Text.RegularExpressions
Public Class InstagramHelper

    Private Const IMG_URL_PATTERN As String = "http://(.*).jpg"
    Private Shared Regex As Regex

    Public Shared Function GetImageURL(imgURL As String) As String

      Try
      Using wc As New WebClient
      Dim src As String = wc.DownloadString(imgURL)

      Regex = New Regex(IMG_URL_PATTERN)
      Dim match As Match = Regex.Match(src)

      Return match.Groups(0).Value.ToString()
      End Using

      Catch ex As WebException
      Throw New Exception(ex.Message)
      End Try

    End Function
End Class

You can then call it like.
PHP Code

<?php 
Dim imgURL 
As String = InstagramHelper.GetImageURL("http://instagram.com/p/xPgjyMgUdN/?modal=true")
PictureBox1.Image = New Bitmap(New MemoryStream(New WebClient().DownloadData(imgURL))) 

But like ByteBlast said, it's easier to inspect element. But I guess this could be good for learning purposes.

Well, don't forget to save it to the folder, because that was the intention. To download the image to the folder, that picturebox is just to show the image (:
Coder looking for partner with good ideas


PM me.

PictureBox1.Image.Save(Application.Startup & imgURL & ".jpg")
Try to use string.Format rather than: var1 & var2 & var3

I've updated your code a little bit and removed some not needed variables.

Updated: https://pastr.me/!/jqVYqb

Apart from that, good work!
I only use https://ricochet.im - ricochet:lmi3tdtlsnziqwdk

Jabber: [email protected]
(Jan 11, 2015 12:32 PM)stackoverflowin Wrote:  Try to use string.Format rather than: var1 & var2 & var3

I've updated your code a little bit and removed some not needed variables.

Updated: https://pastr.me/!/jqVYqb

Apart from that, good work!

I don't understand that part :

PHP Code

<?php 
Dim imgURL 
As String = Nothing
    Dim id 
As String = Nothing
    Dim path 
As String = Nothing 

Why are you setting variables to nothing ? default values of strings are already nothing, so you don't need to specifiate any value. :)

Also, you should use :

PHP Code

<?php 
Using Web 
As New WebClient
'do
End Using 
(Jan 11, 2015 12:55 PM)Naywyn Wrote:  I don't understand that part :

PHP Code

<?php 
Dim imgURL 
As String = Nothing
    Dim id 
As String = Nothing
    Dim path 
As String = Nothing 

Why are you setting variables to nothing ? default values of strings are already nothing, so you don't need to specifiate any value. :)

Also, you should use :

PHP Code

<?php 
Using Web 
As New WebClient
'do
End Using 

I didn't change that part of the code, that is the original code :P
I only use https://ricochet.im - ricochet:lmi3tdtlsnziqwdk

Jabber: [email protected]
(Jan 11, 2015 12:55 PM)Naywyn Wrote:  I don't understand that part :

PHP Code

<?php 
Dim imgURL 
As String = Nothing
    Dim id 
As String = Nothing
    Dim path 
As String = Nothing 

Why are you setting variables to nothing ? default values of strings are already nothing, so you don't need to specifiate any value. :)

You do it to initialize the variable. Avoids null reference cases when reading without assigning a value along with various other reasons.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by jj89XDJun 2, 2026 03:58 AM 2 1,498 Jun 2, 2026 03:58 AM
Last Post: palmer_style2009
[.NET] by alaabawaneh3Jul 23, 2024 02:33 PM 58 16,191 Jul 23, 2024 02:33 PM
Last Post: King Zikama
[Python] by EdgeDec 13, 2021 02:46 PM 3 239 Dec 13, 2021 02:46 PM
Last Post: Edge