我知道在创建 .desktop 文件时,可以将 metadata::trusted 设置为 true 和 false,以便能够将图标作为可执行文件启动。然而,让我感兴趣的是以下事实:
当右键单击 .desktop 文件并“允许启动”时,它所做的唯一一件事就是将 metadata::trusted 设置为 true。但是,正如预期的那样,该图标会立即更改为 .desktop 文件 Icon= 中描述的图标。
但是,当通过命令行将 metadata::trusted 设置为 false 或 true 时,图标似乎不会改变其行为 $ gio set android-studio.desktop metadata::trusted false
一旦我手动刷新桌面(Alt + F2 >> 重启),环境就会刷新并且图标再次变为可执行,但整个环境都会重新启动。
那么,在设置了 metadata::trusted 之后,“允许/禁止启动”究竟做了什么?它如何在不刷新整个桌面的情况下刷新 .desktop 本身中的元数据?
我目前正在使用以下脚本从Google云端硬盘获取常规文件。它工作正常,基本上是来自用户@ user115202的代码。
现在,我需要将其用于Whatsapp备份,该备份存储在GoogleDrive的“备份”下,而不是常规文件。
该工具WhatsApp的Google Drive提取器(Google Drive API)似乎不再起作用。
有人知道替代品吗?
import requests
def download_file_from_google_drive(id, destination):
def get_confirm_token(response):
for key, value in response.cookies.items():
if key.startswith('download_warning'):
return value
return None
def save_response_content(response, destination):
CHUNK_SIZE = 32768
with open(destination, "wb") as f:
for chunk in response.iter_content(CHUNK_SIZE):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_token(response)
if token:
params = { 'id' : id, …Run Code Online (Sandbox Code Playgroud)