Skip to content

Instantly share code, notes, and snippets.

@CyrusF
Created May 17, 2019 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CyrusF/b48ccd2b542f63183ed383a161ad6540 to your computer and use it in GitHub Desktop.
Save CyrusF/b48ccd2b542f63183ed383a161ad6540 to your computer and use it in GitHub Desktop.
a python script for generate garageband resource url for download faster in China mainland
s="""
balabala
plist 内容右键 Copy 到这里
balabala
"""
while "<string>" in s:
x = s.partition("<string>")[2].partition("</string>")[0]
if x.endswith(".pkg"):
print("http://audiocontentdownload.apple.com/lp10_ms3_content_2016/"+x) # 注意不要删除 http://
s = s.partition("</string>")[2]
@CyrusF
Copy link
Author

CyrusF commented May 17, 2019

一共四个步骤:

  1. 找到 garageband 目录并打开 plist 文件(可能需要 Xcode)

Step1

  1. 启动 garageband 之后打开「活动监视器 / Activity Monitor」,双击 garageband 进程,在第三个选项卡「打开的文件和端口」中拉到最后,找到一个包含“audiocontentdownload.apple.com”的链接

Step2

  1. 将第一步 plist 中的 package 右键复制到代码中“balabala”附近的位置,将第二步中的链接复制到“print”语句附近的位置,注意不要删除 http:// 前缀

Step3

  1. 运行 python 脚本,获取输出结果,之后将结果复制到迅雷,记得合并任务

Step4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment