harryr0se / giant_bomb_cli

Command line utility for downloading and streaming videos from Giant Bomb!
MIT License
18 stars 6 forks source link

Error while trying to download --video_show 10 (Playdate) #6

Open simonk83 opened 5 years ago

simonk83 commented 5 years ago

If I try and grab everything with video_show ID 10 (Playdate), it never grabs everything, it seems to stop midway and doesn't show all results.

simon@Proxbuntu:~/Downloads/giant_bomb_cli$ python giant_bomb_cli.py --sort asc --filter --download --download-archive /home/simon/Downloads/giant_bomb_cli/archive.txt --output /mnt/nas/BB --quality hd --video_show 10

The last file it tries to grab it this from 2017:

Playdate: GBW Playdate: Dead Rising 01/25/2017 (Playdate) [84:46] ID:11840
        This mall ain't big enough for two photographers, Kent.
Skipping download as id is already in download archive

If I specifically search for the word Playdate as below, it seems to be having a problem with a specific file that's causing it to halt:

simon@Proxbuntu:~/Downloads/giant_bomb_cli$ python giant_bomb_cli.py --sort asc --filter  --download --download-archive /home/simon/Downloads/giant_bomb_cli/archive.txt --output /mnt/nas/BB --quality hd --name "playdate"
Appending json extension to download archive
GBE Playdate: Middle-earth: Shadow of Mordor (None) [122:34] ID:9532
        We dive into Middle-earth and try as we might, cannot rid it of Scar-Artist.
Downloading https://giantbomb-pdl.akamaized.net/2014/10/03/mc_gbeplaydate_100314_4000.mp4 to /mnt/nas/BB/GBE_Playdate_Middle-earth_Shadow_of_Mordor.mp4
--2019-02-09 10:49:42--  https://giantbomb-pdl.akamaized.net/2014/10/03/mc_gbeplaydate_100314_4000.mp4?api_key=e0dca0e835cfe07f61fc1eabf0edc46909059bfd
Resolving giantbomb-pdl.akamaized.net (giantbomb-pdl.akamaized.net)... 203.109.255.177
Connecting to giantbomb-pdl.akamaized.net (giantbomb-pdl.akamaized.net)|203.109.255.177|:443... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

    The file is already fully retrieved; nothing to do.

GBE: Playdate: Call of Duty: Advanced Warfare (None) [0:00] ID:9685
        We jump right into the start of the newest Call of Duty to see what Kevin Spacey is really like.
Traceback (most recent call last):
  File "giant_bomb_cli.py", line 348, in <module>
    main()
  File "giant_bomb_cli.py", line 342, in main
    output_response(json_obj, args, download_archive)
  File "giant_bomb_cli.py", line 214, in output_response
    filename += "." + url.split(".")[-1]
AttributeError: 'NoneType' object has no attribute 'split'
Delver26 commented 5 years ago

I've had the exact same problem, and was able to fix it (and your other issue) with some workarounds. I've just created a pull request that fixes both of your open issues.

simonk83 commented 5 years ago

Awesome, thanks for that :) I've been having a tinker but my python is ... bad. Something to do with some videos on the site not actually having a video associated to them?

Delver26 commented 5 years ago

No worries at all. I actually don't know python at all myself, but was able to piece together something that seems to work (I make no guarantees of quality!)

Yeah i think the issue is around malformed URLs or something. They're validated in some parts of the code, but not when we use the URL to construct the name, so i just added in a bypass for that bit, if the URL is empty.

simonk83 commented 5 years ago

Ok, while we're talking about this, I don't know if you've noticed but if you do search for video_show 10 (Playdate), it never sees or grabs anything past Dead Rising 01/25/2017 (even now with your fix in place). Looking at the site and the various apps, it does seem that the videos are categorised correctly as being under Playdate, so I guess there's something else going on...

Delver26 commented 5 years ago

Odd, what command are you using to run? If I use giant_bomb_cli.py --filter --video_show 10 it'll return me back the 25 most recent playdates, starting from the resident evil playdate on 13/03/19

simonk83 commented 5 years ago

Command up the top, maybe it's the sort ascending. I thought it would return every single item regardless though...

EDIT: Ahhh, just reading the code again, if you don't use the -l flag to set a limit, it defaults to 25. Makes sense then! I guess I just need to add a huge limit to grab everything 😊