praw-dev / praw

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

Home Page:http://praw.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can't upload any video or image into reddit.

neotod opened this issue · comments

Describe the Bug

Hi.
I could upload video and image before into my own subreddit.
Since 2 days ago, I don't know what happened that I can't upload anymore.
I also tried proxies too (proxychains, HTTP_PROXY, HTTPS_PROXY), but none of them worked.

Is this because of the Reddit API not being free anymore (based on the news)? or some other reasons?
(to mention that I was able get the posts, but couldn't upload any post)

Desired Result

Being able to upload image or video onto reddit.

Code to reproduce the bug

import praw
import os
from dotenv import load_dotenv

load_dotenv()

VIDEO_PATH = "VIDEO_PATH"
IMAGE_PATH = "IMAGE_PATH"
SUBREDDIT = "influencer_test"

# reddit api credentials
reddit = praw.Reddit(
    client_id=os.environ["REDDIT_CLIENT_ID"],
    client_secret=os.environ["REDDIT_CLIENT_SECRET"],
    password=os.environ["REDDIT_PASSWORD"],
    user_agent=os.environ["REDDIT_USER_AGENT"],
    username=os.environ["REDDIT_USERNAME"],
)

# subreddit name
subreddit = reddit.subreddit(SUBREDDIT)

# Output: redditdev
print(f"title: {subreddit.title}")
# Output: reddit development

print(f"description: {subreddit.description}")

print('uploading image')
subreddit.submit_image(title="test", image_path=IMAGE_PATH)

The Reddit() initialization in my code example does not include the following parameters to prevent credential leakage:

client_secret, password, or refresh_token.

  • Yes

Relevant Logs

[proxychains] Dynamic chain  ...  127.0.0.1:7890  ...  www.reddit.com:443  ...  OK
[proxychains] Dynamic chain  ...  127.0.0.1:7890  ...  oauth.reddit.com:443  ...  OK
title: influencer_test
description: 

uploading image
[proxychains] Dynamic chain  ...  127.0.0.1:7890  ...  reddit-uploaded-media.s3-accelerate.amazonaws.com:443  ...  OK

This code has previously worked as intended.

Yes

Operating System/Environment

linux - manjaro

Python Version

3.10

PRAW Version

7.7.0

Prawcore Version

2.3.0

Anything else?

No response

I'm having a similar issue, I'm seeing
Error: General exception - Invalid URL 'https:https://reddit-uploaded-media.s3-accelerate.amazonaws.com/': No Host Supplied
Relevant code: reddit.subreddit("subreddit").submit_image(title, image)
Everything was working fine until a day ago. I'm not sure if that duplicated https is just part of the error message or if this is truly being caused by a malformed URL

I'm seeing the same thing here.

I'm also getting the same "Invalid URL" error on the "submit_gallery" method.

I'm back up and running now

This issue is stale because it has been open for 30 days with no activity.

Remove the Stale label or comment or this will be closed in 30 days.

This issue was closed because it has been stale for 30 days with no activity.