Imvu Icon Downloader [Updated 6-3-2017]

DataMine
by DataMine · 20 posts
12 years ago in Mafia Tools
Posted 12 years ago · Author
IMVU Icon Downloader

Image

The IMVU Icon Downloader is a program that lets you download the product icons for product from the IMVU catalog. You can tell it to download icons from a specific category of the catalog or tell it to download from a specific creator's catalog.

If you need to back up your product icons from your account or just like to collect icons, this is the tool for you.


Image
Posted 12 years ago
i did something very simlar to this for a game server i use to do how ever i did mine a lil diff i wrote a very simple web browser on mine that handles js and cookies and a way to clear cookies etc. then i made a new tab on th right hand of the webbrowser that showed the source of the webpage then i had my parser take that as a string and make the matchs etc. so if it was me i would do a webbrowser that handles js and cookies then after you logged in have the app or unlock the url feild so you can go to the page thats my help for you here is some code i was able to dig up on google that might help you
Code
'This code is used to empty the cookies from the user's computer / We call function from here.
Private Declare Function GetUserName _
Lib "advapi32.dll" Alias "GetUserNameW" ( _
ByVal lpBuffer As Long, _
ByRef nSize As Long) As Long

Private Declare Function SHGetSpecialFolderPath _
Lib "shell32.dll" Alias "SHGetSpecialFolderPathA" ( _
ByVal hwnd As Long, _
ByVal pszPath As String, _
ByVal csidl As Long, _
ByVal fCreate As Long) As Long

Private Const CSIDL_COOKIES As Long = &H21

'This calls the function that deletes the cookies.
Public Sub Command1_Click()
Dim sPath As String
sPath = Space(260)
Call SHGetSpecialFolderPath(0, sPath, CSIDL_COOKIES, False)
sPath = Left$(sPath, InStr(sPath, vbNullChar) - 1) & "\*.txt*"
On Error Resume Next
Kill sPath

End Sub

* Show webpage's source code:
Code
Private Sub Form_Load()
Text1.Text = Form1.browser.Document.documentElement.innerHTML
End Sub

* JavaScripts handeling
Code
WebBrowser1.Silent = True 

also found a tut from google that shows you how to build step by step a web browser in vb http://www.vbforums.com/showthread.php?t=406671
Posted 12 years ago · Author
A webbrowser control works but I prefer to go with http requests, it's easier and it makes gui look better the less controls you got on it. Especially for a simple tool.

I'll take a look at the code you posted and see if it helps. Thanks.
Posted 12 years ago
yea i agree with you but atm thats all i can think of for a login i have a freidn that uses vb on a daily bases ill talk to him asap and see what he says
Posted 12 years ago · Author
airbender wrote:
yea i agree with you but atm thats all i can think of for a login i have a freidn that uses vb on a daily bases ill talk to him asap and see what he says


I've seen an example for logging in to Facebook but I could never adapt it to work with Imvu. It involves cookie containers with the http requests but I couldn't get any code to work.
Posted 12 years ago
if you go have a look at my login bot thats written in php it might help you as there isnt only just 2 feilds to login to imvu
there is 5 and i know 4 of there vuales working on the 5th one once we get them you can prolly do https request just like im doing with curl and php

Code
            ' Create a request using a URL that can receive a post. 
            Dim request As WebRequest = WebRequest.Create("https://secure.imvu.com/login/login/ ")
            ' Set the Method property of the request to POST.
            request.Method = "POST"
            ' Create POST data and convert it to a byte array.
            Dim postData As String = "sauce=&avatarname=uravi&password=urpass&password_strength=urpwstearh&sendto=&bcld=urbcld"
            Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
            ' Set the ContentType property of the WebRequest.
            request.ContentType = "application/x-www-form-urlencoded"
            ' Set the ContentLength property of the WebRequest.
            request.ContentLength = byteArray.Length
            ' Get the request stream.
            Dim dataStream As Stream = request.GetRequestStream()
            ' Write the data to the request stream.
            dataStream.Write(byteArray, 0, byteArray.Length)
            ' Close the Stream object.
            dataStream.Close()
            ' Get the response.
            Dim response As WebResponse = request.GetResponse()
            ' Display the status.
            Console.WriteLine(CType(response, HttpWebResponse).StatusDescription)
            ' Get the stream containing content returned by the server.
            dataStream = response.GetResponseStream()
            ' Open the stream using a StreamReader for easy access.
            Dim reader As New StreamReader(dataStream)
            ' Read the content.
            Dim responseFromServer As String = reader.ReadToEnd()
            ' Display the content.
            Console.WriteLine(responseFromServer)
            ' Clean up the streams.
            reader.Close()
            dataStream.Close()
            response.Close()
        End Sub
    End Class
End Namespace



here is some cod e that should do the same thing my php script does exp im not sure how to store the cookie bit rusty with vb so i have it writing the cookie to the console so if you can test this and if it works then figure aa way to store the cookie somewhere then just do your script and use that cookie like i did with php like i said tho i havent tested this just wrote it up off of some explmes i found online hope it helps bro
Posted 12 years ago · Author
Thank you Airebender, I haven't to get the login code to work yet. But while I was getting ready to start working on it, I decided to look at my code and clean up my GUI. Doing this, I discovered a slight bug in the drop-down box selection index code, I also tidied up my GUI and figured out how to do multiple file extensions.

Before, My program would save every icon as a png regardless of what it originally was. This could be fine and dandy but I decided to make it support gifs, pngs, bmps, jpgs and tiffs. So now it will save the image in it's correct format and keep animations or quality. I don't know why I didn't think about doing this before. The code was actually very simple:

Code
Dim extension As String = iconurl
extension = extension.Substring(extension.LastIndexOf(".") + 1).ToLower
Select Case extension
   Case "bmp"
     Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".bmp", System.Drawing.Imaging.ImageFormat.Bmp)
   Case "jpg", "jpeg"
     Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
   Case "gif"
     Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".gif", System.Drawing.Imaging.ImageFormat.Gif)
   Case "png"
     Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".png", System.Drawing.Imaging.ImageFormat.Png)
   Case "tif", "tiff"
     Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & fn & ".tiff", System.Drawing.Imaging.ImageFormat.Tiff)
End Select


Granted I did have to look it up and then work it into my code. I had no idea about parsing the extension. It works beautifully though.


Now I just need to work on getting it to save the original file name as well, then the login code and I am all done. Then I'll release it for the family.
Posted 12 years ago
sweet also when i get my new rig setup ill be able to help you out more overe here in vb atm i only have a pos pc that wont run microsoft visual basics or anything like that for the matter but my new system will hten i will be abel to test the code i give you and help yyou write the login biit if your still stuck on it
Posted 12 years ago · Author
airbender wrote:
sweet also when i get my new rig setup ill be able to help you out more overe here in vb atm i only have a pos pc that wont run microsoft visual basics or anything like that for the matter but my new system will then i will be able to test the code i give you and help you write the login bit if your still stuck on it



Ah, ok. Yeah I got everything else done on it, just trying to figure out the login code.


Edit:

OK, I couldnt figure out the login code. It wasn't worth the time and effort for this project. Too many errors or non functioning code.

So here's the final version. Re wrote the multithreading code, fixed the icon counter code, removed the login code and controls, added the ability to enter your own url and cleaned everything up.

Image
Source Code Download

Code
Imports System.Text.RegularExpressions
Imports System.IO
Imports System.Text

Public Class Form1

    Dim ithread As New System.Threading.Thread(AddressOf iDown)
    Dim Url As String = ""

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CheckForIllegalCrossThreadCalls = False
        Cnclbtn.Enabled = False
        Rnbtn.Enabled = False
    End Sub

    Private Sub ExportUrlsToFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExportUrlsToFileToolStripMenuItem.Click
        Dim myStream As Stream
        Dim saveFileDialog1 As New SaveFileDialog()
        saveFileDialog1.Filter = "txt files (*.txt)|*.txt"
        saveFileDialog1.FilterIndex = 2
        saveFileDialog1.RestoreDirectory = True
        If saveFileDialog1.ShowDialog() = DialogResult.OK Then
            myStream = saveFileDialog1.OpenFile
            Using sw As StreamWriter = New StreamWriter(myStream)
                sw.Write(iUrlbx.Text)
                sw.Close()
            End Using
            If (myStream IsNot Nothing) Then
                myStream.Close()
            End If
        End If
    End Sub

    Private Sub OpenImvuShopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenImvuShopToolStripMenuItem.Click
        Process.Start("http://www.imvu.com/shop/")
    End Sub

    Private Sub ResetToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetToolStripMenuItem.Click
        For Each ctrl As Control In ogb.Controls
            If TypeOf ctrl Is TextBox Then
                CType(ctrl, TextBox).Text = String.Empty
            End If
            If TypeOf ctrl Is ComboBox Then
                CType(ctrl, ComboBox).SelectedIndex = 9
            End If
        Next ctrl
        For Each ctrl As Control In ugb.Controls
            If TypeOf ctrl Is RichTextBox Then
                CType(ctrl, RichTextBox).Text = String.Empty
            End If
        Next ctrl
        For Each ctrl As Control In igb.Controls
            If TypeOf ctrl Is PictureBox Then
                CType(ctrl, PictureBox).Image = Nothing
            End If
        Next ctrl
        If Rnbtn.Enabled = False Then
            Rnbtn.Enabled = True
        End If
        If Cnclbtn.Enabled = False Then
            Cnclbtn.Enabled = True
        End If
    End Sub

    Private Sub CategoryBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CategoryBox.SelectedIndexChanged
        If CategoryBox.SelectedIndex = 0 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-128&page="
        ElseIf CategoryBox.SelectedIndex = 1 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-78&page="
        ElseIf CategoryBox.SelectedIndex = 2 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-75&page="
        ElseIf CategoryBox.SelectedIndex = 3 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-89&page="
        ElseIf CategoryBox.SelectedIndex = 4 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-90&page="
        ElseIf CategoryBox.SelectedIndex = 5 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-76&page="
        ElseIf CategoryBox.SelectedIndex = 6 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-101&page="
        ElseIf CategoryBox.SelectedIndex = 7 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-153&page="
        ElseIf CategoryBox.SelectedIndex = 8 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-40-324&page="
            '''''''''''''''''''''''''''''
            '''''''''''''''''''''''''''''
        ElseIf CategoryBox.SelectedIndex = 10 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-69&page="
        ElseIf CategoryBox.SelectedIndex = 11 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-70&page="
        ElseIf CategoryBox.SelectedIndex = 12 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-67&page="
        ElseIf CategoryBox.SelectedIndex = 13 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-91&page="
        ElseIf CategoryBox.SelectedIndex = 14 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-92&page="
        ElseIf CategoryBox.SelectedIndex = 15 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-68&page="
        ElseIf CategoryBox.SelectedIndex = 16 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-102&page="
        ElseIf CategoryBox.SelectedIndex = 17 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-71&page="
        ElseIf CategoryBox.SelectedIndex = 18 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=106-41-316&page="
            '''''''''''''''''''''''''''''
            '''''''''''''''''''''''''''''
        ElseIf CategoryBox.SelectedIndex = 22 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366&page="
        ElseIf CategoryBox.SelectedIndex = 23 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-2102&page="
        ElseIf CategoryBox.SelectedIndex = 24 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1787&page="
        ElseIf CategoryBox.SelectedIndex = 25 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1030&page="
        ElseIf CategoryBox.SelectedIndex = 26 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1907&page="
        ElseIf CategoryBox.SelectedIndex = 27 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1564&page="
        ElseIf CategoryBox.SelectedIndex = 28 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1980&page="
        ElseIf CategoryBox.SelectedIndex = 29 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-366-1901&page="
            '''''''''''''''''''''''''''''
            '''''''''''''''''''''''''''''
        ElseIf CategoryBox.SelectedIndex = 33 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027&page="
        ElseIf CategoryBox.SelectedIndex = 34 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-909&page="
        ElseIf CategoryBox.SelectedIndex = 35 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-1199&page="
        ElseIf CategoryBox.SelectedIndex = 36 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-906&page="
        ElseIf CategoryBox.SelectedIndex = 37 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-949&page="
        ElseIf CategoryBox.SelectedIndex = 38 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-1332&page="
        ElseIf CategoryBox.SelectedIndex = 39 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-917&page="
        ElseIf CategoryBox.SelectedIndex = 40 Then
            Url = "http://www.imvu.com/shop/web_browse.php?cat=107-1027-950&page="
        ElseIf CategoryBox.SelectedIndex = 43 Then
            Url = InputBox("Enter Your Own Catalog Url", "")
        End If
    End Sub

    Private Sub Rnbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rnbtn.Click
        If Not ithread.IsAlive Then
            ithread.Start()
        End If
    End Sub

    Private Sub Cnclbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cnclbtn.Click
        If ithread.IsAlive Then
            ithread.Abort()
        End If
    End Sub

    Sub iDown()
        Dim i As Integer = 1
        Dim fn As Integer = 1

        If Not String.IsNullOrEmpty(plbox.Text) Then
            Cnclbtn.Enabled = True
            rnbtn.Enabled = False
            If Not Directory.Exists(Environment.CurrentDirectory + "\Icons\") Then
                Directory.CreateDirectory(Environment.CurrentDirectory + "\Icons\")
            End If
            If Not Url.Contains("&page=") Then
                Url = String.Concat(Url, "&page=")
            End If
            Do Until i = plbox.Text + 1
                Url = Url & i
                Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(Url)
                Dim response As System.Net.HttpWebResponse = request.GetResponse
                Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
                Dim imvuicons As String = sr.ReadToEnd
                Dim r As New System.Text.RegularExpressions.Regex("<img src=""http://userimages0.*-akm\.imvu\.com/productdata/.*"" class=""thumbnail"" alt="".*"" width=""100"" height=""80""/>", RegexOptions.IgnoreCase)
                Dim matches As MatchCollection = r.Matches(imvuicons)
                For Each icon As Match In matches
                    iUrlbx.AppendText(icon.Value.Split("""").GetValue(1) + vbNewLine)
                    Dim iconurl As String = icon.Value.Split("""").GetValue(1)
                    Iconbx.Image = New System.Drawing.Bitmap(New IO.MemoryStream(New System.Net.WebClient().DownloadData(iconurl)))
                    System.Threading.Thread.Sleep(100)
                    Dim extension As String = iconurl
                    Dim name As String = iconurl
                    name = name.Substring(name.LastIndexOf("/") + 1).ToLower
                    extension = extension.Substring(extension.LastIndexOf(".") + 1).ToLower
                    Select Case extension
                        Case "bmp"
                            Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Bmp)
                        Case "jpg", "jpeg"
                            Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Jpeg)
                        Case "gif"
                            Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Gif)
                        Case "png"
                            Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Png)
                        Case "tif", "tiff"
                            Iconbx.Image.Save(Environment.CurrentDirectory + "\Icons\" & name, System.Drawing.Imaging.ImageFormat.Tiff)
                    End Select
                Next
                i = i + 1
            Loop
            Cnclbtn.Enabled = False
            Rnbtn.Enabled = True
        Else
            MsgBox("Please Enter A Valid Page Limit")
        End If
    End Sub

    Private Sub iUrlbx_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles iUrlbx.TextChanged
        Dim lineInfo As New StringBuilder()
        lineInfo.Append(iUrlbx.Lines.Length.ToString())
        If Not String.IsNullOrEmpty(iUrlbx.Text) Then
            icount.Text = lineInfo.ToString() - 1
        Else
            icount.Text = "0"
        End If
    End Sub

    Private Sub plbox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles plbox.TextChanged
        If String.IsNullOrEmpty(plbox.Text) Then
            Rnbtn.Enabled = False
        Else
            Rnbtn.Enabled = True
        End If
    End Sub
End Class
Posted 12 years ago
wow nice work bro very good job :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT