• 0

Need with with Imgur program


Question

Hey guys,

I wanted to work on a new project just for fun, so I thought a program that downloaded imgur galleries would be cool. I am working on it, but the program will run through duplicates after 51 images usually.

I've looked at all i can and can't find the problem. My guess is that it's the server resetting me. I wanted a challenge so i tried to get past it. I tried creating a new url connection each time, I also created a seperate class that did the downloading and creating a new object of that class everytime but it didn't work.

Thoughts?

Source

http://shayconcepts.com/programming/ImgurGalleryDownloader/imgurDL.zip

Link to comment
https://www.neowin.net/forum/topic/1110175-need-with-with-imgur-program/
Share on other sites

19 answers to this question

Recommended Posts

  • 0

You are parsing the HTML page. Don't do that. Use imgur's API instead - from the documentation, you can just append ".xml" to any gallery page and it returns the gallery as an XML file.

In general, don't parse HTML pages unless there is no other way. It's not easy and it can change any day, making your program useless.

  • 0
  On 04/10/2012 at 20:30, Aethec said:

You are parsing the HTML page. Don't do that. Use imgur's API instead - from the documentation, you can just append ".xml" to any gallery page and it returns the gallery as an XML file.

In general, don't parse HTML pages unless there is no other way. It's not easy and it can change any day, making your program useless.

Thanks! I'll take a look.

EDIT: it seems it only returns 56 images though :/

  On 05/10/2012 at 01:51, Dr_Asik said:

I learned about regex and it has worked really well for me! I'll take a look at your link and find a better way to parse HTML. Thanks!

  • 0
  On 05/10/2012 at 04:14, thatguyandrew1992 said:
I learned about regex and it has worked really well for me! I'll take a look at your link and find a better way to parse HTML. Thanks!
If you really need to parse HTML, you should use a proper HTML library; for Java there is HtmlUnit and Jsoup at least. Better would be to not parse any HTML and use imgur's API as Aethec suggested.
  • 0
  On 05/10/2012 at 06:05, Dr_Asik said:

If you really need to parse HTML, you should use a proper HTML library; for Java there is HtmlUnit and Jsoup at least. Better would be to not parse any HTML and use imgur's API as Aethec suggested.

But when using the API, I append the .xml but it doesn't show ALL the images in the gallery

  • 0
  On 12/10/2012 at 04:27, thatguyandrew1992 said:

Ok guys, I need some more help. How do I get the xml of an album? They are apparently different than galleries! The xml page isn't coming up. Or if there isn't an xml, what is recommended to get the images?

Ex

http://imgur.com/a/HKtAR/

It's all there in the API documentation: http://api.imgur.com/resources_anon#album

Example: http://api.imgur.com/2/album/HKtAR

  • 0
  On 12/10/2012 at 14:05, ZakO said:

It's all there in the API documentation: http://api.imgur.com...rces_anon#album

Example: http://api.imgur.com/2/album/HKtAR

Thanks! I'm learning how to use APIs, I know this is all obvious. I thought I had looked through this. ill be sure to look extra hard!, >.<

This topic is now closed to further replies.
  • Posts

    • Mozilla shuts down even more Firefox services you might still be using by David Uzondu A few weeks ago, Mozilla announced that its Pocket and Fakespot services were getting the axe as the company focuses more on Firefox. It is a complete shutdown. Pocket, the read-it-later service Mozilla bought in 2017, will stop working on July 8, 2025. You have until October 8 to get your saved articles out before they are deleted forever. Fakespot, which helped you spot garbage product reviews, is also being sunsetted. But the house cleaning does not stop with those two. Neowin has spotted a shutdown notice dated June 26, 2025 for Deep Fake Detector, the Firefox extension that was supposed to tell you if a piece of text was written by a human or an AI chatbot. That tool used a combination of Mozilla's own proprietary ApolloDFT engine and open-source models like ZipPy to give you a verdict on what you were reading. The notice says: This brings us to the AI tools. Following the pattern, the Orbit website was updated with a banner that announced the service would shut down by June 26. Orbit was Mozilla's big privacy-first experiment in AI. It was a Firefox add-on that could summarize articles and answer questions about a webpage's content without sending your data to a third party. This is not an AI exit. Mozilla is simply changing how it delivers AI features. Orbit's private, self-contained setup can be replaced with the new sidebar built directly into Firefox, letting you connect to third-party chatbots like ChatGPT and Gemini. But, for Orbit users, this is still a huge loss, as a key feature of the service was privacy. Your prompts were handled by Mistral LLM (Mistral 7B) within Mozilla's GCP instance and were not shared with other companies for model training, which was a huge selling point for people tired of being the product. Mozilla keeps saying these cuts are necessary. As the only major browser not owned by a tech giant, its resources are limited; hence, the need to focus its cash and engineering talent on the core Firefox browser to compete.
    • Too close to the Ultra, I have and love an Ultra but have held onto my watch 6 classic because it is nicer when wearing a suit to work.
    • Intel v32.0.101.6881 graphics driver fixes a popular multiplayer hero shooter by Taras Buria Intel is rolling out a new graphics driver under version 32.0.101.6881. This WHQL release does not contain much. In fact, there is only a single fix for a popular multiplayer hero shooter. The new driver fixes crashes when launching Overwatch 2 (DirectX 12) on High or Ultra graphics settings on Intel Arc A-Series graphics cards. From the changelog: Overwatch 2 (DX12) may experience an application crash while launching the game with High or Ultra graphics quality settings. Known bugs in the drive include the following: Intel Arc B-Series Graphics Products: Fortnite may experience an application crash when “Performance - Lower Graphical Fidelity” is selected as Rendering Mode. Recommendation is to use default Rendering Mode – DX12. Visual corruptions may appear in certain scenarios with multiple application interactions. Call of Duty: Black Ops 6 (DX12) may exhibit flickering corruption in certain scenes during gameplay. Returnal (DX12) may experience an application crash during gameplay with Ray-Tracing settings turned on. Call of Duty: Warzone 2.0 (DX12) may exhibit corruptions on water areas in certain scenarios. SPECapc for Maya 2024 may experience intermittent application freeze during benchmark. PugetBench for Davinci Resolve Studio V19 may experience an application crash while running the benchmark. HWiNFO may incorrectly report number of Xe Cores for certain Intel Arc B-Series Graphics Products. Intel Arc A-Series Graphics Products: Returnal (DX12) may experience an application crash during gameplay with Ray-Tracing settings turned on. Marvel’s Spider-Man 2 (DX12) may experience an application crash with Ray-Tracing and XeSS enabled. PugetBench for Davinci Resolve Studio V19 may experience an application crash while running the benchmark. Intel Core Ultra Series 1 with built-in Intel Arc GPUs: Adobe Premiere Pro may fail to import video. Mitigation is to use Intel NPU Driver version 32.0.100.3717 or lower. PugetBench for Davinci Resolve Studio V19 may experience errors intermittently with benchmark preset set to Extended. Intel Core Ultra Series 2 with built-in Intel Arc GPUs: Valorant (DX11) may fail to enumerate supported resolutions in game settings. Adobe Premiere Pro may experience an intermittent application crash. Adobe Premiere Pro may fail to import video. Mitigation is to use Intel® NPU Driver version 32.0.100.3717 or lower. PugetBench for Davinci Resolve Studio V19 may experience errors intermittently with benchmark preset set to Extended. You can install Intel 32.0.101.6881 WHQL driver on PCs with 64-bit Windows 10 and Windows 11 with the following graphics products from Intel: Discrete GPUs Integrated GPUs Intel Arc A-Series (Alchemist) Intel Arc B-Series (Battlemage) Intel Iris Xe Discrete Graphics (DG1) Intel Core Ultra Series 2 (Lunar Lake and Arrow Lake) Intel Core Ultra (Meteor Lake) Intel Core 14th Gen (Raptor Lake Refresh) Intel Core 13th Gen (Raptor Lake) Intel Core 12th Gen (Alder Lake) Intel Core 11th Gen (Tiger Lake) You can download the driver from the official website here. Full release notes are available here (PDF).
    • Just look at the shiney shiney Vista clone, ignore the fact that they are a disaster in anything AI related. Roll on the class actions for all iPhone 16 owners.
  • Recent Achievements

    • Collaborator
      Carltonbar earned a badge
      Collaborator
    • Explorer
      MusicLover2112 went up a rank
      Explorer
    • Dedicated
      MadMung0 earned a badge
      Dedicated
    • Rookie
      CHUNWEI went up a rank
      Rookie
    • Enthusiast
      the420kid went up a rank
      Enthusiast
  • Popular Contributors

    1. 1
      +primortal
      508
    2. 2
      ATLien_0
      268
    3. 3
      +FloatingFatMan
      248
    4. 4
      +Edouard
      201
    5. 5
      snowy owl
      168
  • Tell a friend

    Love Neowin? Tell a friend!