我试着用praw在任何地方都可以本地上传一张图片给编辑。
这在我的计算机上很好,但是在throws上任何地方都会抛出403个错误。(不过,图片还是会上传的。)
我看到中有403个错误是由于它们的代理白名单造成的,但reddit是已被白名单的网站之一,而praw使用requests,pythonanywhere说它是一个兼容的库。另外,常规的submit也可以正常工作。
File "/home/ibid/.local/lib/python3.7/site-packages/praw/models/reddit/subreddit.py", line 780, in submit
我试图得到每个Reddit帖子的评论。
这就是我用来获得天赋清单的方法:
import praw
import webbrowser
r = praw.Reddit('OAuth testing example by u/_Daimon_ ver 0.1 see '
'https://praw.readthedocs.org/en/latest/'
'pages/oauth.html for source')
r.set_oauth_app_info(client_id='[clie
我已经看过几个这样的问题,但是没有回应,所以我会试一试。当我使用以下代码时:
import praw, time
r = praw.Reddit(user_agent="Bot experiment by redacted")
r.login('redacted', 'redacted')
我得到一个连接错误,它具有以下回溯:
Traceback (most recent call last):
File "redacted", line 5, in <module>
r.login('redac
我编写了一个编辑机器人,它将搜索subreddit的评论,如果评论说它会回复它。然后将注释id写入文本文件,这样就不会对同一个注释进行两次注释。
以下是代码:
import praw
import time
import sys
import random
r = praw.Reddit('Posts Feels gif in response to someone saying feels'
'by: Mjone77')
r.login('Feels_Bot', 'nottherealpassword&
我尝试在不使用API的情况下登录instagram,但收到403响应?凭据是正确的,但仍然得到响应。在这件事上有什么帮助吗?
import requests
main_url = 'https://www.instagram.com/'
login_url = main_url+'accounts/login/'
user_agent = 'User-Agent: Mozilla/5.0 (iPad; CPU OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6
我正在使用Apache作为我正在构建的RESTful服务的前端。对服务的所有访问都应该通过HTTPS来实现,所以我希望Apache能够响应任何HTTP访问,其中包含403条消息,说明需要安全访问。
我将如何配置Apache来做到这一点?
<VirtualHost *:80>
ServerName api.digiumcloud.net
# Stuff to force 403 responses here
</VirtualHost>
我在0fees.net上创建了一个测试主机。我还创建了一个小的php脚本,它将接收我希望发送的文件。
我尝试了很多方法,但是服务器使用HTTP403禁止响应;详细输出中的实际消息是
* About to connect() to ********* port 80 (#0)
* Trying 209.190.85.12... * connected
* Connected to ******* (209.190.85.12) port 80 (#0)
> POST /index.php HTTP/1.1
Host: *************
Accept: */*
Content-
出于某种安全原因,我们增加了一个通用弹簧过滤器,它执行横切检查,并在安全规则被破坏时删除403。
该解决方案在同步端点(即返回ResponseBody<SomeDTO>)的情况下运行良好。
但是,我们有几个返回ResponseBodyEmitter的异步端点。
If (checks == false){
// Then the filter should erase the response body and override the http status to 403.
}
对于异步方法,在响应发送期间执行检查。
因此,端点可以在开头200与响应体发送,然后删除与403和空体的
当我运行此代码时,我一直收到403错误。有人知道我如何解决这个问题吗?我尝试了这个网站上发布的一些其他修复程序,但它们似乎不起作用,任何帮助都将不胜感激。
using System;
using System.Net;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
using (WebClient client = new WebClient())
{
Consol