Dr_FarFar

[+] Python Android Script Copy Photos From WhatsApp Profiles

Apr 9th, 2014
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.42 KB | None | 0 0
  1. /***
  2. ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
  3. ▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  4. ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌
  5. ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
  6. ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄█░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌
  7. ▐░▌ ▐░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  8. ▐░▌ ▐░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀
  9. ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
  10. ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▄ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
  11. ▐░░░░░░░░░░▌ ▐░▌ ▐░▌▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
  12. ▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀ ▀
  13.  
  14.  
  15.  
  16. ~~~ :xD: Have Fun. Don't Forget To Bookmark This Website :xD:
  17. ~~~ https://www.FaceBook.com/Dr.FarFar
  18. ~~~ http://Dr-FarFar.BlogSpot.com/
  19.  
  20. */
  21.  
  22. ###################################################################################################
  23.  
  24. I think everybody reading this must be using WhatsApp by now. :-D
  25.  
  26. I am amazed by how much ignorance people have.
  27. I have been told by many people that it is secure to share profile photo on WhatsApp
  28. since the application doesnt allow to save other people profile photos.
  29. Well when I saw my one friend dying to get his friend's profile photos over whatsapp (offcourse it was a girl, Haaa hahaa.)
  30. I just checked the whats app folder location and showed him that the profile photos are temporary saved in this folder.
  31. For his phone it was "/storage/sdcard0/WhatsApp/Profile Pictures" path.
  32.  
  33. Then one more issue came forward WhatsApp deletes the profile photos automatically after some couple of days.
  34. (No I didnt bothered to find out after how much time).
  35.  
  36. So I told him to copy the files to other folder using some file manager.
  37. But as always I was thinking of automation in my mind.
  38. So I wrote a python script which can be run by using qpython for android (http://qpython.com/).
  39. This script copies the files in the default directory of WhatsApp to user specified directory.
  40. (You will have to specify the directory in the python script,
  41. its easy this way in Android instead of going for command line and etc.
  42.  
  43. So again one small problem was there.
  44. Every time the WhatsApp profile photo is changes it is stored by using the mobile number as filename.
  45. So by default if you copy files it would overwrite them.
  46. So you cannot use filenames to identify if the file different from existing photo in the bkp directory.
  47. So I used the md5 library in python to check the md5 sum of the files in the backup directory
  48. and tally it with same phone number file in the WhatsApp directory.
  49. So now the script copies the filename and count the files with similar name in the backup directory
  50. and paste with the one added counter name.
  51.  
  52. E.g. +919887766554-0.jpg , +919887766554-1.jpg , +919887766554-2.jpg etc.
  53.  
  54. So there you go my friend. (and any one else who needed similar script)
  55.  
  56. Steps to use
  57.  
  58. 1) Install qpython on your android phone from http://qpython.com/
  59.  
  60. 2) download file WatsAppCp.py from https://sites.google.com/site/neo1981/files/WatsAppCp.py?attredirects=0&d=1
  61.  
  62. 3) copy file to the scripts directory of qpython.
  63.  
  64. 4) Edit the file and pur your phones path to the WhatsApp profile pictures
  65. -- Change following variables in py file
  66. --- mysrc = "/storage/sdcard0/WhatsApp/Profile Pictures"
  67. --- mydst = "/storage/sdcard0/.Wats App profile BKP"
  68. --Here mysrc is the WhatsApp profile pictures folder
  69. --and mydst is bkp folder which you can specify
  70.  
  71. 5) Run the WatsAppCp.py file from qpython
  72.  
  73. 6) File whill show copying message for every photo which is copied.
  74.  
  75. ########################################################################################################################
  76.  
  77. https://www.facebook.com/Dr.FarFar
  78. http://Dr-FarFar.BlogSpot.com/
  79.  
  80. ________ __________ __________
  81. ___ __ \___________ ____/______ ____________ ____/______ _________
  82. __ / / /__ ___/__ /_ _ __ `/__ ___/__ /_ _ __ `/__ ___/
  83. _ /_/ / _ /___ _ __/ / /_/ / _ / _ __/ / /_/ / _ /
  84. /_____/ /_/ _(_)/_/ \__,_/ /_/ /_/ \__,_/ /_/
  85.  
  86. ~\ Dr.FarFar /~
Advertisement
Add Comment
Please, Sign In to add comment