HEX
Server: LiteSpeed
System: Linux osault1.hostarmada.net 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: tucom (1048)
PHP: 8.4.24
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.6/site-packages/gdown/__pycache__/parse_url.cpython-36.pyc
3

LBj��@s*ddlZddlZddlmZddd�ZdS)�N)�urllib_parseTcCs�tj|�}tj|j�}|jdk}|jjd�}|s8||fSd}d|krb|d}t|�dkr�|d}nBdd	d
ddd
ddg}x,|D]$}	tj	|	|j�}
|
r||
j
�d}Pq|W|r�|r�tjdj
dj
|�d��||fS)z�Parse URLs especially for Google Drive links.

    file_id: ID of file on Google Drive.
    is_download_link: Flag if it is download link of Google Drive.
    �drive.google.com�docs.google.comz/ucN�id�rz^/file/d/(.*?)/(edit|view)$z$^/file/u/[0-9]+/d/(.*?)/(edit|view)$z(^/document/d/(.*?)/(edit|htmlview|view)$z1^/document/u/[0-9]+/d/(.*?)/(edit|htmlview|view)$z,^/presentation/d/(.*?)/(edit|htmlview|view)$z5^/presentation/u/[0-9]+/d/(.*?)/(edit|htmlview|view)$z,^/spreadsheets/d/(.*?)/(edit|htmlview|view)$z5^/spreadsheets/u/[0-9]+/d/(.*?)/(edit|htmlview|view)$z�You specified a Google Drive link that is not the correct link to download a file. You might want to try `--fuzzy` option or the following url: {url}z!https://drive.google.com/uc?id={})�url)rr)r�urlparse�parse_qs�query�hostname�path�endswith�len�re�match�groups�warnings�warn�format)r�warning�parsedr
Z	is_gdriveZis_download_linkZfile_idZfile_ids�patterns�patternr�r�0/tmp/pip-build-44150kxb/gdown/gdown/parse_url.py�	parse_urls:




r)T)rrZ	six.movesrrrrrr�<module>s