Giter VIP home page Giter VIP logo

Comments (11)

LearningnRunning avatar LearningnRunning commented on September 17, 2024 2

저 해결했습니다! 2가지 수정하였습니다.

spell_checker.py
payload에서 passportKey와 _callback를 추가해야했습니다.

payload = { 'passportKey': 'curl값 copy로 알 수 있습니다.', '_callback': 'curl값 copy로 알 수 있습니다.', 'q': text, 'color_blindness': '0' }

그리고 61번째 줄 수정

`data = json.loads(r.text)` ->


`json_data = re.search(r'\((.*)\)', r.text).group(1)
# Parse the JSON data into a Python dictionary
data = json.loads(json_data)`

from py-hanspell.

hammnii-study avatar hammnii-study commented on September 17, 2024

저도 동일한 문제가 발생하는데 어떻게 해결하면 될까요?

from py-hanspell.

LearningnRunning avatar LearningnRunning commented on September 17, 2024

62 번째 줄
` data = json.loads(r.text)

# data = json.loads(r)
print("data", data)`

OUTPUT
data {'message': {'error': '유효한 키가 아닙니다.'}}

api 키에러 같습니다.

from py-hanspell.

hays-zero avatar hays-zero commented on September 17, 2024

저는 spell_checker.check() 동작 확인을 위하여 한글 문자열을 그대로 넣었는데 키에러가 발생했습니다. api 키에러면 어떻게 조치해야 동작할까요?

from py-hanspell.

abikisyo avatar abikisyo commented on September 17, 2024

payload = { 'passportKey': '880af1461495c9169ca22466896beac17fd71d7a', '_callback': 'jQuery1124024353107794965956_1697593724680', 'q': text, 'color_blindness': '0' }
윗 분 덕분에 이렇게 수정해서 해결했습니다!

from py-hanspell.

hays-zero avatar hays-zero commented on September 17, 2024

두 분 덕에 해결법을 알게 된 듯 합니다. 감사합니다. 그런데 제가 초보라 curl값은 무엇인지, 어떻게 얻는지 공부하고 시도해보았지만 잘 안 되었습니다. 그래서 혹시 abikisyo님께서 올려주신 curl값 카피를 제가 그대로 사용해도 되는건가요? 아니면 curl값은 개인마다 고유로 생성해서 넣어야 하는 값인가요?

from py-hanspell.

abikisyo avatar abikisyo commented on September 17, 2024

image
저도 아는게 없는 초보자라 설명까지는 못드릴 것 같구! 키값은 크롬 개발자도구를 이용해서 찾았습니다!

from py-hanspell.

miiiiiion0 avatar miiiiiion0 commented on September 17, 2024

payload = { 'passportKey': '880af1461495c9169ca22466896beac17fd71d7a', '_callback': 'jQuery1124024353107794965956_1697593724680', 'q': text, 'color_blindness': '0' } 윗 분 덕분에 이렇게 수정해서 해결했습니다!

혹시 payload 부분만 수정하니 해결하셨는지요? data 형식도 변경하셨을까요?

from py-hanspell.

hays-zero avatar hays-zero commented on September 17, 2024

모든 분들 감사드립니다. 해결하였습니다! 저는 payload 부분과,

import re json_data = re.search(r'\((.*)\)', r.text).group(1) # Parse the JSON data into a Python dictionary data = json.loads(json_data)

부분을 모두 수정하였습니다!

from py-hanspell.

bbkaeul avatar bbkaeul commented on September 17, 2024

두 부분을 수정해도 여전히 result를 찾지 못하는 에러({'message': {'error': '유효한 키가 아닙니다.'}})가 발생하는데 혹시 해결하신 분들 어떤 부분을 수정하셨는지 참고해 볼 수 있을까요?

  1. payload = { 'passportKey': '880af1461495c9169ca22466896beac17fd71d7a'
    , '_callback': 'jQuery1124024353107794965956_1697593724680'
    , 'q': text, 'color_blindness': '0' }

2.61 data = json.loads(r.text) ->
json_data = re.search(r'((.*))', r.text).group(1)
data = json.loads(json_data)`

추적해 보니 base_url은 맞는건지 의문이 듭니다.
base_url = 'https://m.search.naver.com/p/csearch/ocontent/util/SpellerProxy'

from py-hanspell.

abikisyo avatar abikisyo commented on September 17, 2024

passportKey랑 _callback 부분이 주기적으로 바뀌는 걸로 알고있어요 오늘은 f889d5ee7ab9379c02331da9f04cc4b36001c960랑 jQuery112403327001357005035_1697768508744로 바뀌어있네요~

from py-hanspell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.