ryelogheat / xpbot

Analyze a media file, identify the TMDB/IMDB, and generate all the necessary info to upload a torrent to a private tracker using the UNIT3D codebase
56 stars 27 forks source link

uploading images #20

Closed rj-d2 closed 3 years ago

rj-d2 commented 3 years ago

hi i answered on a closed issue, not sure if you have seen it, so i start a new issue here, im having trouble uploading images, i did some testing,

Uploading to imgyukle
Uploading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% -:--:--
All images uploaded successfully

does not upload anything, the bbcode_images.txt is empty

imgbox only allows uploading filesizes up to 10 mb (i think) when the filesize is higher i get this error and the script stops.

Uploading to imgbox
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home27/user/.apps/xpbot-master/./auto_upload.py:1839 in <module>                             │
│                                                                                                  │
│   1836 │   media_info_duration = MediaInfo.parse(torrent_info["raw_video_file"] if "raw_video_f  │
│   1837 │   torrent_info["duration"] = str(media_info_duration.duration).split(".", 1)[0]  # Thi  │
│   1838 │   # Call function to actually take screenshots & upload them (different file)           │
│ ❱ 1839 │   console.print(take_upload_screens(duration=torrent_info["duration"],                  │
│   1840 │   │   │   │   │   │   │   │   │     upload_media_import=torrent_info["raw_video_file"]  │
│   1841 │   │   │   │   │   │   │   │   │     torrent_title_import=torrent_info["title"],         │
│   1842 │   │   │   │   │   │   │   │   │     base_path=working_folder,                           │
│                                                                                                  │
│ /home27/user/.apps/xpbot-master/images/upload_screenshots.py:198 in take_upload_screens       │
│                                                                                                  │
│   195 │   │   # Now we start the actual upload process                                           │
│   196 │   │   for host_site, host_api in upload_to_host_dict.items():                            │
│   197 │   │   │   # Call the function that actually uploads the images                           │
│ ❱ 198 │   │   │   upload_status = upload_screens(img_host=host_site, api_key=host_api, working   │
│   199 │   │   │   # Check "thumbs_links_dict" to verify images have uploaded and we have all t   │
│   200 │   │   │                                                                                  │
│   201 │   │   │   # if upload_status is equal to "failed" then we simply skip everything below   │
│                                                                                                  │
│ /home27/user/.apps/xpbot-master/images/upload_screenshots.py:129 in upload_screens            │
│                                                                                                  │
│   126 │   │   loop = asyncio.get_event_loop()                                                    │
│   127 │   │   loop.run_until_complete(imgbox_upload(list_of_images))                             │
│   128 │   │                                                                                      │
│ ❱ 129 │   │   logging.info(f"imgbox edit_url: {edit_url[0]}")  # log the edit url                │
│   130 │                                                                                          │
│   131 │   # return the dict so we can verify the images successfully uploaded and if so then f   │
│   132 │   return thumbs_links_dict                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range

Originally posted by @solongandthxforallthefish in https://github.com/ryelogheat/xpbot/issues/11#issuecomment-852885100

ryelogheat commented 3 years ago

Yeah I'm pretty sure imgyukle revoked the public API key they had in their API documentation screenshots lol, I'm removing them for now as an available imghost, If you have any suggestions for good image hosts let me know, I'd be happy to add them

freeimage has a limit of 64MB & imgbb at 32MB, Would that work for your uploads?

ryelogheat commented 3 years ago

I've added a filesize limit to imgbox uploads now, It'll try another host (if enabled in config.env) if the filesize if over 10MB

As I said earlier ^^ I've removed imgyukle so I recommend you use imgbb for your primary image host, then imgbox, and finally freeimage as a backup.