import requests
import time
import re
import getpass
from urllib import parse
from bs4 import BeautifulSoup
import win32api
from playsound import playsound
try:
def login(userId, userPw):
global SESS
SESS = requests.session()
SESS.headers = {
"X-Requested-With" : "XMLHttpRequest",
"Referer" : "https://www.dcinside.com/",
"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
}
soup = BeautifulSoup(SESS.get("https://www.dcinside.com/").text, features="lxml")
loginForm = soup.find("form", attrs={"id" : "login_process"})
Lauth = loginForm.find_all("input", attrs={"type" : "hidden"})[2]
login_data = {
"user_id" : userId,
"pw" : userPw,
"s_url" : "https://www.dcinside.com/",
"ssl" : "Y",
Lauth["name"]:Lauth["value"]
}
req = SESS.post("https://dcid.dcinside.com/join/member_check.php", data=login_data)
SESS.headers = {
"X-Requested-With" : "XMLHttpRequest",
"Referer" : "https://gallog.dcinside.com/%s/posting" % userId,
"User-Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
}
if "history.back(-1);" in req.text or "잘" in req.text:
return "로그인 세션 생성 실패"
else:
return "로그인 세션 생성 성공"
userId = input('dc id: ')
userPw = getpass.getpass('dc pass: ')
login = login(userId, userPw)
if "실" in login:
raise Exception(login)
pageurl = 'https://gallog.dcinside.com/'+userId+'/'+input('posting 혹은 comment 혹은 scrap: ')+'?p=1'
def post(x):
global SESS
reqdel = SESS.post('https://gallog.dcinside.com/'+userId+'/ajax/log_list_ajax/delete',data={'no': pagelist[x]}).text
print(reqdel)
if 'captcha' in reqdel:
while(1):
playsound('c.mp3')
time.sleep(1)
while(1):
reqpage = SESS.get(pageurl).text
pagelist = re.findall('(?:data-no)=(?:["\']\W+\s*(?:\w+)\()?["\']([^\'"]+)[\'"]', reqpage)
print(pagelist)
pagelist.remove('${code}')
for i in range(20):
post(i)
except KeyboardInterrupt:
pass
except Exception as e:
print(e)
win32api.MessageBox(0, str(e),str(e), 0x00000010)
댓글 영역
획득법
① NFT 발행
작성한 게시물을 NFT로 발행하면 일주일 동안 사용할 수 있습니다. (최초 1회)
② NFT 구매
다른 이용자의 NFT를 구매하면 한 달 동안 사용할 수 있습니다. (구매 시마다 갱신)
사용법
디시콘에서지갑연결시 바로 사용 가능합니다.