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
55 stars 27 forks source link

upload to imgbox broken #11

Closed rj-d2 closed 3 years ago

rj-d2 commented 3 years ago

upload to imgbox ist not working anymore,

Uploading to imgbox
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home27/user/.apps/xpbot-master/auto_upload.py:1725 in <module>                               │
│                                                                                                  │
│   1722 │   media_info_duration = MediaInfo.parse(torrent_info["raw_video_file"] if "raw_video_f  │
│   1723 │   torrent_info["duration"] = str(media_info_duration.duration).split(".", 1)[0]  # Thi  │
│   1724 │   # Call function to actually take screenshots & upload them (different file)           │
│ ❱ 1725 │   console.print(take_upload_screens(duration=torrent_info["duration"],                  │
│   1726 │   │   │   │   │   │   │   │   │     upload_media_import=torrent_info["raw_video_file"]  │
│   1727 │   │   │   │   │   │   │   │   │     torrent_title_import=torrent_info["title"],         │
│   1728 │   │   │   │   │   │   │   │   │     base_path=working_folder,                           │
│                                                                                                  │
│ /home27/user/.apps/xpbot-master/images/upload_screenshots.py:191 in take_upload_screens       │
│                                                                                                  │
│   188 │   │   # Now we start the actual upload process                                           │
│   189 │   │   for host_site, host_api in upload_to_host_dict.items():                            │
│   190 │   │   │   # Call the function that actually uploads the images                           │
│ ❱ 191 │   │   │   upload_status = upload_screens(img_host=host_site, api_key=host_api, working   │
│   192 │   │   │   # Check "thumbs_links_dict" to verify images have uploaded and we have all t   │
│   193 │   │   │                                                                                  │
│   194 │   │   │   # if upload_status is equal to "failed" then we simply skip everything below   │
│                                                                                                  │
│ /home27/user/.apps/xpbot-master/images/upload_screenshots.py:122 in upload_screens            │
│                                                                                                  │
│   119 │   │   for file in os.listdir(working_folder + "/images/screenshots/"):                   │
│   120 │   │   │   list_of_images.append(working_folder + "/images/screenshots/" + file)  # app   │
│   121 │   │   asyncio.run(imgbox_upload(list_of_images))  # call the function that uploads ima   │
│ ❱ 122 │   │   logging.info(f"imgbox edit_url: {edit_url[0]}")  # log the edit url                │
│   123 │                                                                                          │
│   124 │   # return the dict so we can verify the images successfully uploaded and if so then f   │
│   125 │   return thumbs_links_dict                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range
ryelogheat commented 3 years ago

This fix should do it https://github.com/ryelogheat/xpbot/commit/c9fe7b2327537c4d289708857a2b56507bd740dc

update the project on your end and try it again, Let me know if it works so I can close this issue

ryelogheat commented 3 years ago

Going to assume its working for you again and close this issue, Thanks for the report :+1:

rj-d2 commented 3 years ago

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