Policy:User-Agent policy/ko: Difference between revisions

From Wikimedia Foundation Governance Wiki
Content deleted Content added
m 31 revisions imported from meta:User-Agent_policy/ko
FuzzyBot (talk | contribs)
Updating to match new version of source page
Line 1: Line 1:
<languages />
<languages />
{{notice|1=<div lang="en" dir="ltr" class="mw-content-ltr">
{{notice|1=이 페이지는 순전히 정보를 제공하며 현재 상황을 반영합니다. 이 주제에 대해 토론하려면 위키기술-l [[Special:MyLanguage/Mailing lists|메일링 리스트]]를 사용하십시오.}}
This page is purely informative, reflecting the current state of affairs. To discuss this topic, please use the wikitech-l [[:m:Special:MyLanguage/Mailing lists|mailing list]].
</div>}}


<div lang="en" dir="ltr" class="mw-content-ltr">
2010년 2월 15일부터 위키미디어 사이트는 모든 요청에 대해 '''HTTP [[w:User-Agent|사용자-에이전트]] 헤더'''를 요구합니다. 이것은 기술 직원이 내린 운영 결정이며 기술 메일링 리스트에 발표되고 논의되었습니다.<ref>[https://lists.wikimedia.org/pipermail/wikitech-l/2010-February/thread.html#46764 Wikitech-l 2010년 2월 주제별 아카이브]</ref><ref>[https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/R4RU7XTBM5J3BTS6GGQW77NYS2E4WGLI/ 사용자-에이전트: - Wikitech-l - lists.wikimedia.org]</ref> 이유는 사용자-에이전트 문자열을 보내지 않는 클라이언트는 대부분 프로젝트에 도움이 되지 않고 서버에 많은 부하를 유발하는 잘못된 동작을 하는 스크립트라는 것입니다. <code>python-requests/x</code>와 같이 설명이 없는 기본값으로 시작하는 사용자 에이전트 문자열은 위키미디어 사이트(또는 웹사이트의 일부, 예: api.php)에서 차단될 수도 있습니다.
As of February 15, 2010, Wikimedia sites require a '''HTTP [[{{lwp|User-Agent}}|User-Agent]] header''' for all requests. This was an operative decision made by the technical staff and was announced and discussed on the technical mailing list.<ref>[[mailarchive:wikitech-l/2010-February/thread.html#46764|The Wikitech-l February 2010 Archive by subject]]</ref><ref>[[listarchive:list/wikitech-l@lists.wikimedia.org/thread/R4RU7XTBM5J3BTS6GGQW77NYS2E4WGLI/|User-Agent: - Wikitech-l - lists.wikimedia.org]]</ref> The rationale is, that clients that do not send a User-Agent string are mostly ill behaved scripts that cause a lot of load on the servers, without benefiting the projects. User-Agent strings that begin with non-descriptive default values, such as <code>python-requests/x</code>, may also be blocked from Wikimedia sites (or parts of a website, e.g. <code>api.php</code>).
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
설명적인 사용자-에이전트 헤더를 보내지 않는 요청(예: 브라우저 또는 스크립트에서)은 다음과 같은 오류 메시지가 나타날 수 있습니다.
Requests (e.g. from browsers or scripts) that do not send a descriptive User-Agent header, may encounter an error message like this:
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
:"스크립트는 연락처 정보와 함께 유익한 사용자 에이전트 문자열을 사용해야 합니다. 그렇지 않으면 예고 없이 차단될 수 있습니다."
:''Scripts should use an informative User-Agent string with contact information, or they may be blocked without notice.''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
허용되지 않은 사용자 에이전트의 요청에는 다음과 같이 덜 유용한 오류 메시지가 표시될 수 있습니다:
Requests from disallowed user agents may instead encounter a less helpful error message like this:
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
:"현재 서버에 기술적인 문제가 발생했습니다. 몇 분 후에 다시 시도하십시오.
:''Our servers are currently experiencing a technical problem. Please try again in a few minutes.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
이 변경 사항은 api.php 또는 기타 명령줄 프로그램을 통해 위키백과와 같은 위키미디어 웹사이트에 자동으로 액세스하는 스크립트(봇)에 영향을 미칠 가능성이 높습니다.<ref>[//www.mediawiki.org/w/index.php?title=API:FAQ#do_I_get_HTTP_403_errors.3F API:FAQ - 미디어위]</ref> 봇을 실행하는 경우 다른 많은 봇과 혼동되지 않는 식별자로 봇을 식별하고 귀하에게 연락할 수 있는 방법(예: 로컬 위키의 사용자 페이지, 사용자 페이지)을 제공하는 사용자-에이전트 헤더를 보내주십시오. 위키 간 연결 구문, 관련 외부 웹사이트의 URI 또는 이메일 주소를 사용하는 관련 위키에서, 예:
This change is most likely to affect scripts (bots) accessing Wikimedia websites such as Wikipedia automatically, via api.php or otherwise, and command line programs.<ref>[[:mw:Special:MyLanguage/API:FAQ|API:FAQ - MediaWiki]]</ref> If you run a bot, please send a User-Agent header identifying the bot with an identifier that isn't going to be confused with many other bots, and supplying some way of contacting you (e.g. a userpage on the local wiki, a userpage on a related wiki using interwiki linking syntax, a URI for a relevant external website, or an email address), e.g.:
</div>
<pre>
<pre>
User-Agent: CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org) generic-library/0.0
User-Agent: CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org) generic-library/0.0
</pre>
</pre>


<div lang="en" dir="ltr" class="mw-content-ltr">
일반 형식은 <code><client name>/<version> (<contact information>) <library/framework name>/<version> [<library name>/<version> ...]</code>입니다. 해당되지 않는 부분은 생략 가능합니다.
The generic format is <code><client name>/<version> (<contact information>) <library/framework name>/<version> [<library name>/<version> ...]</code>. Parts that are not applicable can be omitted.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
자동 에이전트를 실행하는 경우 사용자-에이전트 문자열에 "bot" 문자열을 소문자 또는 대문자 조합으로 포함하는 인터넷 전체 규칙을 따르는 것을 고려하십시오. 이것은 위키미디어의 시스템에서 인식되며 트래픽을 분류하고 보다 정확한 통계를 제공하는 데 사용됩니다.
If you run an automated agent, please consider following the Internet-wide convention of including the string "bot" in the User-Agent string, in any combination of lowercase or uppercase letters. This is recognized by Wikimedia's systems, and used to classify traffic and provide more accurate statistics.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
브라우저의 사용자 에이전트를 사용하는 봇과 유사한 동작은 악의적인 것으로 간주되므로 봇에 대한 브라우저의 사용자 에이전트를 복사하지 마십시오.<ref>[//lists.wikimedia.org/pipermail/wikitech-l/2010-February/046783.html [Wikitech-l&#93; 사용자-에이전트:]</ref> "curl", "lwp", "Python-urllib" 등과 같은 일반 에이전트를 사용하지 마십시오. pywikibot과 같은 대규모 프레임워크의 경우 사용자가 너무 많아 "pywikibot"만 다소 모호할 수 있습니다. 특정 작업/스크립트 등에 대한 세부 정보를 포함하는 것은 운영자 외에는 그 세부 정보가 불투명한 경우에도 좋은 생각입니다.<ref>{{cite web|url=https://lists.wikimedia.org/pipermail/mediawiki-api/2014-July/003308.html |title=봇 사용자 에이전트에서 "봇 식별"에 필요한 사항에 대한 설명이 있습니까?|publisher=Mediawiki-api|author=Anomie|date=31 July 2014}}</ref>
Do not copy a browser's user agent for your bot, as bot-like behavior with a browser's user agent will be assumed malicious.<ref>[//lists.wikimedia.org/pipermail/wikitech-l/2010-February/046783.html [Wikitech-l&#93; User-Agent:]</ref> Do not use generic agents such as "curl", "lwp", "Python-urllib", and so on. For large frameworks like pywikibot, there are so many users that just "pywikibot" is likely to be somewhat vague. Including detail about the specific task/script/etc would be a good idea, even if that detail is opaque to anyone besides the operator.<ref>[[mailarchive:mediawiki-api/2014-July/003308.html|title=Clarification on what is needed for "identifying the bot" in bot user-agent?]]</ref>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
웹 브라우저는 일반적으로 사용자-에이전트 문자열을 자동으로 보냅니다. 위의 오류가 발생하면 브라우저 설명서를 참조하여 사용자-에이전트 문자열을 설정하는 방법을 찾으십시오. 개인 정보 보호 강화를 위한 일부 플러그인 또는 프록시는 이 헤더를 표시하지 않을 수 있습니다. 그러나 익명 서핑의 경우 이를 억제하거나 빈 문자열을 보내는 대신 일반 사용자-에이전트 문자열을 보내는 것이 좋습니다. 다른 기능은 웹 사이트에서 귀하를 식별할 가능성이 훨씬 더 높습니다. 개인 정보 보호에 관심이 있는 경우 [https://coveryourtracks.eff.org/ 트랙 커버 프로젝트]를 방문하십시오.
Web browsers generally send a User-Agent string automatically; if you encounter the above error, please refer to your browser's manual to find out how to set the User-Agent string. Note that some plugins or proxies for privacy enhancement may suppress this header. However, for anonymous surfing, it is recommended to send a generic User-Agent string, instead of suppressing it or sending an empty string. Note that other features are much more likely to identify you to a website — if you are interested in protecting your privacy, visit the [//coveryourtracks.eff.org/ Cover Your Tracks project].
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
자바스크립트로 작성된 브라우저 기반 애플리케이션은 일반적으로 이를 호스팅하는 브라우저와 동일한 사용자-에이전트 헤더를 보내야 합니다. 이것은 정책 위반이 아니지만 이러한 애플리케이션은 적절한 에이전트를 제공하기 위해 <code>Api-User-Agent</code> 헤더를 포함하는 것이 좋습니다.
Browser-based applications written in JavaScript are typically forced to send the same User-Agent header as the browser that hosts them. This is not a violation of policy, however such applications are encouraged to include the <code>Api-User-Agent</code> header to supply an appropriate agent.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
2015년부터 위키미디어 사이트는 사용자-에이전트 헤더를 설정하지 않은 클라이언트의 모든 페이지 보기 및 API 요청을 거부하지 않습니다. 따라서 요구 사항이 자동으로 적용되지 않습니다. 오히려 필요에 따라 특정한 경우에 시행될 수 있습니다.<ref>gmane.science.linguistics.wikipedia.technical/83870 ([http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/83870/ deadlink])</ref>
As of 2015, Wikimedia sites do not reject all page views and API requests from clients that do not set a User-Agent header. As such, the requirement is not automatically enforced. Rather, it may be enforced in specific cases as needed.
<span id="Code_examples"></span>
</div><ref>gmane.science.linguistics.wikipedia.technical/83870 ([//thread.gmane.org/gmane.science.linguistics.wikipedia.technical/83870/ deadlink])</ref>
== 코드 예 ==
<div lang="en" dir="ltr" class="mw-content-ltr">
== Code examples ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
위키미디어 위키에서 <code>User-Agent</code> 헤더를 제공하지 않거나 비어 있거나 일반적인 헤더를 제공하면 요청이 HTTP 403 오류와 함께 실패합니다. 다른 미디어위키 설치에도 유사한 정책이 있을 수 있습니다.
On Wikimedia wikis, if you don't supply a <code>User-Agent</code> header, or you supply an empty or generic one, your request will fail with an HTTP 403 error. Other MediaWiki installations may have similar policies.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="JavaScript"></span>
===자바스크립트===
=== JavaScript ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
브라우저 기반 자바스크립트에서 API를 호출하는 경우 <code>User-Agent</code> 헤더에 영향을 미칠 수 없습니다. 브라우저는 자체 헤더를 사용합니다. 이 문제를 해결하려면 <code>Api-User-Agent</code> 헤더를 사용하십시오.
If you are calling the API from browser-based JavaScript, you won't be able to influence the <code>User-Agent</code> header: the browser will use its own. To work around this, use the <code>Api-User-Agent</code> header:
</div>


<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
Line 79: Line 111:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
=== PHP ===
=== PHP ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
PHP에서는 다음과 같은 코드로 사용자 에이전트를 식별할 수 있습니다.
In PHP, you can identify your user-agent with code such as this:
</div>


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
Line 87: Line 123:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
=== cURL ===
=== cURL ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
또는 [[wikipedia:cURL|cURL]]을 사용하는 경우:
Or if you use [[wikipedia:cURL|cURL]]:
</div>


<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
Line 95: Line 135:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Python"></span>
=== 파이썬 ===
=== Python ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
파이썬에서는 [[wikipedia:Requests_(software)|요청]] 라이브러리를 사용하여 헤더를 설정할 수 있습니다:
In Python, you can use the [[wikipedia:Requests_(software)|Requests]] library to set a header:
</div>


<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 109: Line 152:
</syntaxhighlight>
</syntaxhighlight>


<div lang="en" dir="ltr" class="mw-content-ltr">
또는 https://people.wikimedia.org/~bearloga/notes/wdqs-python.html과 같이 [https://sparqlwrapper.readthedocs.io SPARQLWrapper]를 사용하려는 경우:
Or, if you want to use [//sparqlwrapper.readthedocs.io SPARQLWrapper] like in https://people.wikimedia.org/~bearloga/notes/wdqs-python.html:
</div>


<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 122: Line 167:




<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Notes"></span>
== 참고 ==
== Notes ==
</div>
<references />
<references />


<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="See_also"></span>
== 같이 보기 ==
== See also ==
</div>
* 위키미디어 웹사이트에서 작동하려는 [[wikitech:Robot policy|크롤러 및 봇에 대한 정책]]
* <span lang="en" dir="ltr" class="mw-content-ltr">[[wikitech:Robot policy|Policy for crawlers and bots]] that wish to operate on Wikimedia websites</span>


[[Category:Global policies{{#translation:}}]]
[[Category:Bots{{#translation:}}]]
[[Category:Bots{{#translation:}}]]
[[Category:Policies maintained by the Wikimedia Foundation{{#translation:}}]]

Revision as of 00:16, 29 March 2024

As of February 15, 2010, Wikimedia sites require a HTTP User-Agent header for all requests. This was an operative decision made by the technical staff and was announced and discussed on the technical mailing list.[1][2] The rationale is, that clients that do not send a User-Agent string are mostly ill behaved scripts that cause a lot of load on the servers, without benefiting the projects. User-Agent strings that begin with non-descriptive default values, such as python-requests/x, may also be blocked from Wikimedia sites (or parts of a website, e.g. api.php).

Requests (e.g. from browsers or scripts) that do not send a descriptive User-Agent header, may encounter an error message like this:

Scripts should use an informative User-Agent string with contact information, or they may be blocked without notice.

Requests from disallowed user agents may instead encounter a less helpful error message like this:

Our servers are currently experiencing a technical problem. Please try again in a few minutes.

This change is most likely to affect scripts (bots) accessing Wikimedia websites such as Wikipedia automatically, via api.php or otherwise, and command line programs.[3] If you run a bot, please send a User-Agent header identifying the bot with an identifier that isn't going to be confused with many other bots, and supplying some way of contacting you (e.g. a userpage on the local wiki, a userpage on a related wiki using interwiki linking syntax, a URI for a relevant external website, or an email address), e.g.:

User-Agent: CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org) generic-library/0.0

The generic format is <client name>/<version> (<contact information>) <library/framework name>/<version> [<library name>/<version> ...]. Parts that are not applicable can be omitted.

If you run an automated agent, please consider following the Internet-wide convention of including the string "bot" in the User-Agent string, in any combination of lowercase or uppercase letters. This is recognized by Wikimedia's systems, and used to classify traffic and provide more accurate statistics.

Do not copy a browser's user agent for your bot, as bot-like behavior with a browser's user agent will be assumed malicious.[4] Do not use generic agents such as "curl", "lwp", "Python-urllib", and so on. For large frameworks like pywikibot, there are so many users that just "pywikibot" is likely to be somewhat vague. Including detail about the specific task/script/etc would be a good idea, even if that detail is opaque to anyone besides the operator.[5]

Web browsers generally send a User-Agent string automatically; if you encounter the above error, please refer to your browser's manual to find out how to set the User-Agent string. Note that some plugins or proxies for privacy enhancement may suppress this header. However, for anonymous surfing, it is recommended to send a generic User-Agent string, instead of suppressing it or sending an empty string. Note that other features are much more likely to identify you to a website — if you are interested in protecting your privacy, visit the Cover Your Tracks project.

Browser-based applications written in JavaScript are typically forced to send the same User-Agent header as the browser that hosts them. This is not a violation of policy, however such applications are encouraged to include the Api-User-Agent header to supply an appropriate agent.

As of 2015, Wikimedia sites do not reject all page views and API requests from clients that do not set a User-Agent header. As such, the requirement is not automatically enforced. Rather, it may be enforced in specific cases as needed.

[6]

Code examples

On Wikimedia wikis, if you don't supply a User-Agent header, or you supply an empty or generic one, your request will fail with an HTTP 403 error. Other MediaWiki installations may have similar policies.

JavaScript

If you are calling the API from browser-based JavaScript, you won't be able to influence the User-Agent header: the browser will use its own. To work around this, use the Api-User-Agent header:

// Using XMLHttpRequest
xhr.setRequestHeader( 'Api-User-Agent', 'Example/1.0' );
// Using jQuery
$.ajax( {
    url: 'https://example/...',
    data: ...,
    dataType: 'json',
    type: 'GET',
    headers: { 'Api-User-Agent': 'Example/1.0' },
} ).then( function ( data )  {
    // ..
} );
// Using mw.Api
var api = new mw.Api( {
    ajax: {
        headers: { 'Api-User-Agent': 'Example/1.0' }
    }
} );
api.get( ... ).then( function ( data ) {
    // ...
});
// Using Fetch
fetch( 'https://example/...', {
    method: 'GET',
    headers: new Headers( {
        'Api-User-Agent': 'Example/1.0'
    } )
} ).then( function ( response ) {
    return response.json();
} ).then( function ( data ) {
    // ...
});

PHP

In PHP, you can identify your user-agent with code such as this:

ini_set( 'user_agent', 'CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org)' );

cURL

Or if you use cURL:

curl_setopt( $curl, CURLOPT_USERAGENT, 'CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org)' );

Python

In Python, you can use the Requests library to set a header:

import requests

url = 'https://example/...'
headers = {'User-Agent': 'CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org)'}

response = requests.get(url, headers=headers)
from SPARQLWrapper import SPARQLWrapper, JSON

url = 'https://example/...'
user_agent = 'CoolBot/0.0 (https://example.org/coolbot/; coolbot@example.org)'

sparql = SPARQLWrapper(url, agent = user_agent )
results = sparql.query()


Notes

  1. The Wikitech-l February 2010 Archive by subject
  2. User-Agent: - Wikitech-l - lists.wikimedia.org
  3. API:FAQ - MediaWiki
  4. [Wikitech-l] User-Agent:
  5. title=Clarification on what is needed for "identifying the bot" in bot user-agent?
  6. gmane.science.linguistics.wikipedia.technical/83870 (deadlink)

See also