mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-09 18:26:19 +00:00
Update documentation
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>GetCdnFileRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="get_cdn_file.html">GetCdnFileRequest</a></li></ul><h1>GetCdnFileRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.getCdnFile#395f69da file_token:<a href="../../index.html#bytes">bytes</a> offset:<a href="../../index.html#long">long</a> limit:<a href="../../index.html#int">int</a> = <a href="../../types/upload/cdn_file.html">upload.CdnFile</a></pre><button onclick="cp('from telethon.tl.functions.upload import GetCdnFileRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/upload/cdn_file.html">upload.CdnFile</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/upload/cdn_file.html">CdnFile</a></td><td><a href="../../constructors/upload/cdn_file_reupload_needed.html">CdnFileReuploadNeeded</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>file_token</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr><tr><td><b>offset</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>limit</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>UnknownMethodError</code></td><td>The method you tried to call cannot be called on non-CDN DCs.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.GetCdnFileRequest(
|
||||
file_token=<em>b'arbitrary\x7f data \xfa here'</em>,
|
||||
offset=-12398745604826,
|
||||
limit=100
|
||||
))
|
||||
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>GetCdnFileHashesRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="get_cdn_file_hashes.html">GetCdnFileHashesRequest</a></li></ul><h1>GetCdnFileHashesRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.getCdnFileHashes#91dc3f31 file_token:<a href="../../index.html#bytes">bytes</a> offset:<a href="../../index.html#long">long</a> = <a href="../../index.html#vector">Vector</a><<a href="../../types/file_hash.html">FileHash</a>></pre><button onclick="cp('from telethon.tl.functions.upload import GetCdnFileHashesRequest');">Copy import to the clipboard</button><h3>Returns</h3><p>A list of the following type is returned.</p><table><tr><td><a href="../../types/file_hash.html">FileHash</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/file_hash.html">FileHash</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>file_token</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr><tr><td><b>offset</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 2 known errors:</p><table><tr><td><code>CdnMethodInvalidError</code></td><td>This method cannot be invoked on a CDN server. Refer to https://core.telegram.org/cdn#schema for available methods.</td></tr><tr><td><code>RsaDecryptFailedError</code></td><td>Internal RSA decryption failed.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.GetCdnFileHashesRequest(
|
||||
file_token=<em>b'arbitrary\x7f data \xfa here'</em>,
|
||||
offset=-12398745604826
|
||||
))
|
||||
<strong>for</strong> x <strong>in</strong> result:
|
||||
print(x)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>GetFileRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="get_file.html">GetFileRequest</a></li></ul><h1>GetFileRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.getFile#be5335be flags:# precise:flags.0?<a href="../../index.html#true">true</a> cdn_supported:flags.1?<a href="../../index.html#true">true</a> location:<a href="../../types/input_file_location.html">InputFileLocation</a> offset:<a href="../../index.html#long">long</a> limit:<a href="../../index.html#int">int</a> = <a href="../../types/upload/file.html">upload.File</a></pre><button onclick="cp('from telethon.tl.functions.upload import GetFileRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/upload/file.html">upload.File</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/upload/file.html">File</a></td><td><a href="../../constructors/upload/file_cdn_redirect.html">FileCdnRedirect</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>location</b></td><td style="text-align:center"><a href="../../types/input_file_location.html">InputFileLocation</a></td><td></td></tr><tr><td><b>offset</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>limit</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>precise</b></td><td style="text-align:center"><a href="../../index.html#true">flag</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>cdn_supported</b></td><td style="text-align:center"><a href="../../index.html#true">flag</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can cause 7 known errors:</p><table><tr><td><code>AuthKeyPermEmptyError</code></td><td>The method is unavailable for temporary authorization key, not bound to permanent.</td></tr><tr><td><code>FileIdInvalidError</code></td><td>The provided file id is invalid. Make sure all parameters are present, have the correct type and are not empty (ID, access hash, file reference, thumb size ...).</td></tr><tr><td><code>InputFetchFailError</code></td><td>Failed deserializing TL payload.</td></tr><tr><td><code>LimitInvalidError</code></td><td>An invalid limit was provided. See https://core.telegram.org/api/files#downloading-files.</td></tr><tr><td><code>LocationInvalidError</code></td><td>The location given for a file was invalid. See https://core.telegram.org/api/files#downloading-files.</td></tr><tr><td><code>OffsetInvalidError</code></td><td>The given offset was invalid, it must be divisible by 1KB. See https://core.telegram.org/api/files#downloading-files.</td></tr><tr><td><code>TimeoutError</code></td><td>A timeout occurred while fetching data from the worker.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.downloads.DownloadMethods.download_media"><code>client.download_media()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.GetFileRequest(
|
||||
location=types.InputFileLocation(
|
||||
volume_id=-12398745604826,
|
||||
local_id=42,
|
||||
secret=-12398745604826,
|
||||
file_reference=<em>b'arbitrary\x7f data \xfa here'</em>
|
||||
),
|
||||
offset=-12398745604826,
|
||||
limit=100,
|
||||
precise=<strong>True</strong>,
|
||||
cdn_supported=<strong>True</strong>
|
||||
))
|
||||
print(result.stringify())</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>GetFileHashesRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="get_file_hashes.html">GetFileHashesRequest</a></li></ul><h1>GetFileHashesRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.getFileHashes#9156982a location:<a href="../../types/input_file_location.html">InputFileLocation</a> offset:<a href="../../index.html#long">long</a> = <a href="../../index.html#vector">Vector</a><<a href="../../types/file_hash.html">FileHash</a>></pre><button onclick="cp('from telethon.tl.functions.upload import GetFileHashesRequest');">Copy import to the clipboard</button><h3>Returns</h3><p>A list of the following type is returned.</p><table><tr><td><a href="../../types/file_hash.html">FileHash</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/file_hash.html">FileHash</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>location</b></td><td style="text-align:center"><a href="../../types/input_file_location.html">InputFileLocation</a></td><td></td></tr><tr><td><b>offset</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.GetFileHashesRequest(
|
||||
location=types.InputFileLocation(
|
||||
volume_id=-12398745604826,
|
||||
local_id=42,
|
||||
secret=-12398745604826,
|
||||
file_reference=<em>b'arbitrary\x7f data \xfa here'</em>
|
||||
),
|
||||
offset=-12398745604826
|
||||
))
|
||||
<strong>for</strong> x <strong>in</strong> result:
|
||||
print(x)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>GetWebFileRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="get_web_file.html">GetWebFileRequest</a></li></ul><h1>GetWebFileRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.getWebFile#24e6818d location:<a href="../../types/input_web_file_location.html">InputWebFileLocation</a> offset:<a href="../../index.html#int">int</a> limit:<a href="../../index.html#int">int</a> = <a href="../../types/upload/web_file.html">upload.WebFile</a></pre><button onclick="cp('from telethon.tl.functions.upload import GetWebFileRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/upload/web_file.html">upload.WebFile</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/upload/web_file.html">WebFile</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>location</b></td><td style="text-align:center"><a href="../../types/input_web_file_location.html">InputWebFileLocation</a></td><td></td></tr><tr><td><b>offset</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>limit</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>LocationInvalidError</code></td><td>The location given for a file was invalid. See https://core.telegram.org/api/files#downloading-files.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.GetWebFileRequest(
|
||||
location=types.InputWebFileLocation(
|
||||
url=<em>'some string here'</em>,
|
||||
access_hash=-12398745604826
|
||||
),
|
||||
offset=42,
|
||||
limit=100
|
||||
))
|
||||
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Methods/Upload</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li></ul><h1>Methods/Upload</h1><p>Click <a href="botindex.html">here</a> to view the requests that you can use as a bot.</p><h1>Available items</h1><table><tr><td><a href="get_cdn_file_hashes.html">GetCdnFileHashesRequest</a></td><td><a href="get_cdn_file.html">GetCdnFileRequest</a></td></tr><tr><td><a href="get_file_hashes.html">GetFileHashesRequest</a></td><td><a href="get_file.html">GetFileRequest</a></td></tr><tr><td><a href="get_web_file.html">GetWebFileRequest</a></td><td><a href="reupload_cdn_file.html">ReuploadCdnFileRequest</a></td></tr><tr><td><a href="save_big_file_part.html">SaveBigFilePartRequest</a></td><td><a href="save_file_part.html">SaveFilePartRequest</a></td></tr></table></div></body></html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>ReuploadCdnFileRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="reupload_cdn_file.html">ReuploadCdnFileRequest</a></li></ul><h1>ReuploadCdnFileRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.reuploadCdnFile#9b2754a8 file_token:<a href="../../index.html#bytes">bytes</a> request_token:<a href="../../index.html#bytes">bytes</a> = <a href="../../index.html#vector">Vector</a><<a href="../../types/file_hash.html">FileHash</a>></pre><button onclick="cp('from telethon.tl.functions.upload import ReuploadCdnFileRequest');">Copy import to the clipboard</button><h3>Returns</h3><p>A list of the following type is returned.</p><table><tr><td><a href="../../types/file_hash.html">FileHash</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/file_hash.html">FileHash</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>file_token</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr><tr><td><b>request_token</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>RsaDecryptFailedError</code></td><td>Internal RSA decryption failed.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.ReuploadCdnFileRequest(
|
||||
file_token=<em>b'arbitrary\x7f data \xfa here'</em>,
|
||||
request_token=<em>b'arbitrary\x7f data \xfa here'</em>
|
||||
))
|
||||
<strong>for</strong> x <strong>in</strong> result:
|
||||
print(x)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>SaveBigFilePartRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="save_big_file_part.html">SaveBigFilePartRequest</a></li></ul><h1>SaveBigFilePartRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.saveBigFilePart#de7b673d file_id:<a href="../../index.html#long">long</a> file_part:<a href="../../index.html#int">int</a> file_total_parts:<a href="../../index.html#int">int</a> bytes:<a href="../../index.html#bytes">bytes</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.upload import SaveBigFilePartRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>file_id</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>file_part</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>file_total_parts</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>bytes</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 6 known errors:</p><table><tr><td><code>FilePartsInvalidError</code></td><td>The number of file parts is invalid.</td></tr><tr><td><code>FilePartEmptyError</code></td><td>The provided file part is empty.</td></tr><tr><td><code>FilePartInvalidError</code></td><td>The file part number is invalid.</td></tr><tr><td><code>FilePartSizeChangedError</code></td><td>The file part size (chunk size) cannot change during upload.</td></tr><tr><td><code>FilePartSizeInvalidError</code></td><td>The provided file part size is invalid.</td></tr><tr><td><code>TimeoutError</code></td><td>A timeout occurred while fetching data from the worker.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.uploads.UploadMethods.upload_file"><code>client.upload_file()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.SaveBigFilePartRequest(
|
||||
file_id=-12398745604826,
|
||||
file_part=42,
|
||||
file_total_parts=42,
|
||||
bytes=<em>b'arbitrary\x7f data \xfa here'</em>
|
||||
))
|
||||
print(result)</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>SaveFilePartRequest</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
||||
<script>
|
||||
document.getElementById("style").href = "../../css/docs."
|
||||
+ (localStorage.getItem("theme") || "light")
|
||||
+ ".css";
|
||||
</script>
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
||||
rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Upload</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="save_file_part.html">SaveFilePartRequest</a></li></ul><h1>SaveFilePartRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||||
upload.saveFilePart#b304a621 file_id:<a href="../../index.html#long">long</a> file_part:<a href="../../index.html#int">int</a> bytes:<a href="../../index.html#bytes">bytes</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.upload import SaveFilePartRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>file_id</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>file_part</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>bytes</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 4 known errors:</p><table><tr><td><code>FilePartEmptyError</code></td><td>The provided file part is empty.</td></tr><tr><td><code>FilePartInvalidError</code></td><td>The file part number is invalid.</td></tr><tr><td><code>InputFetchFailError</code></td><td>Failed deserializing TL payload.</td></tr><tr><td><code>SessionPasswordNeededError</code></td><td>Two-steps verification is enabled and a password is required.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.uploads.UploadMethods.upload_file"><code>client.upload_file()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
||||
<strong>from</strong> telethon <strong>import</strong> functions, types
|
||||
|
||||
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
||||
result = client(functions.upload.SaveFilePartRequest(
|
||||
file_id=-12398745604826,
|
||||
file_part=42,
|
||||
bytes=<em>b'arbitrary\x7f data \xfa here'</em>
|
||||
))
|
||||
print(result)</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
|
||||
Reference in New Issue
Block a user