ShareShortcuts
Fork “DTikTok”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so aabbccddeeffgg2000 gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
60K
Saved
0
Actions
55
Category
API
Version
1.0
Language
EN

Preview

What's New

Version 1.0

First release

Version History
1.0 Dec 7, 2022

First release

What it does

55 actions
  1. Comment
    DTikTok made by user/heismauri on RoutineHub
  2. Dictionary
  3. Get Contents of URL
    https://routinehub.co/api/v1/shortcuts/…/versions/latest
  4. Get Dictionary Value
  5. If
  6. Text
  7. Choose from Menu
    …
  8. Choose from Menu
    Update now
  9. URL
    https://routinehub.co/download/…
  10. Open URLs
  11. Choose from Menu
    Update later
  12. If
  13. Set Variable
    url
  14. If
  15. Get Clipboard
  16. Set Variable
    url
  17. Expand URL
  18. Match Text
  19. URL
    ……
  20. Get Contents of URL
    …
  21. Make HTML from Rich Text
  22. Match Text
  23. Get Dictionary from Input
  24. Choose from Menu
    What would you like to download?
  25. Choose from Menu
    Original video
  26. Set Variable
    original
  27. Choose from Menu
    Unwatermarked video
  28. Set Variable
    unwatermarked
  29. Choose from Menu
    Audio
  30. Set Variable
    music
  31. Choose from Menu
  32. Show Notification
    Downloading "…" by …
  33. Get Contents of URL
    …
  34. Get Type
  35. If
  36. Set Variable
    video
  37. If
  38. Get Contents of URL
    …
  39. Get Type
  40. If
  41. Set Variable
    video
  42. If
  43. Get Contents of URL
    …
  44. Get Type
  45. If
  46. Set Variable
    video
  47. If
  48. Show Notification
    Error - This TikTok cannot be downloaded
  49. Stop This Shortcut
  50. Set Name
  51. Quick Look
  52. If
  53. Save File
  54. If
  55. Save to Photo Album

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/web'
#define color red
#define glyph filmstrip

/*
DTikTok
made by user/heismauri on RoutineHub
*/
const Dictionary = {
	"DTikTok": {
		"api": "https://godownloader.com/api/download",
		"dictionary": "(?\u003c=\u003cscript id=\"__NEXT_DATA__\" type=\"application\\/json\"\u003e)(.*?)(?=\u003c\\/script\u003e)",
		"id": "(?\u003c=(v\\/|video\\/))\\d+",
		"main": "https://godownloader.com/tiktok/"
	},
	"ID": 5870,
	"Name": "DTikTok",
	"Version": "2.1.1"
}
const ContentsOfURL = downloadURL("https://routinehub.co/api/v1/shortcuts/{Dictionary['ID']}/versions/latest")
const LatestVersion = getValue(ContentsOfURL, "Version")

if LatestVersion != Dictionary['Version'] {
	const UpdatePrompt = "An update is available for \\"{Dictionary['Name']}\\"\n\nRelease notes: \n{ContentsOfURL['Notes']}\n\n{Dictionary['Version']} → {ContentsOfURL['Version']}"
	menu UpdatePrompt {
	item "Update now":
		const URL = url("https://routinehub.co/download/{ContentsOfURL['id']}")
		openURL(URL)
	item "Update later":
	}
}

if ShortcutInput {
	@url = ShortcutInput
} else {
	getClipboard()
}
@url
expandURL(@url)
const id = containsText(, Dictionary['DTikTok.id'])
url("{Dictionary['DTikTok.main']}{id}")
const ContentsOfURL1 = downloadURL()
makeHTML(ContentsOfURL1, true)
const Matches = containsText(, Dictionary['DTikTok.dictionary'])

menu "What would you like to download?" {
item "Original video":
	@original = getDictionary(Matches)
item "Unwatermarked video":
	@unwatermarked = DTikTok['props.pageProps.token.nwm']
item "Audio":
	@music = DTikTok['props.pageProps.token.music']
item :
}
showNotification("Downloading \"{DTikTok['props.pageProps.data.title']}\" by {DTikTok['props.pageProps.data.author']}", Dictionary['Name'])
const ContentsOfURL2 = formRequest(Dictionary['DTikTok.api'], "POST", {
	"t": "{token}"
})
const Type = typeOf(ContentsOfURL2)

if Type contains "Media" {
	@video = ContentsOfURL2
} else {
	const ContentsOfURL3 = formRequest(Dictionary['DTikTok.api'], "POST", {
		"t": "{DTikTok['props.pageProps.token.hevc']}"
	})
	const Type1 = typeOf(ContentsOfURL3)
	if Type1 contains "Media" {
		@video = ContentsOfURL3
	} else {
		const ContentsOfURL4 = formRequest(Dictionary['DTikTok.api'], "POST", {
			"t": "{DTikTok['props.pageProps.token.wm']}"
		}, {})
		const Type2 = typeOf(ContentsOfURL4)
		if Type2 contains "Media" {
			@video = ContentsOfURL4
		} else {
			showNotification("Error - This TikTok cannot be downloaded", Dictionary['Name'])
			stop()
		}
	}
}
const RenamedItem = setName(@video, id)
quicklook(RenamedItem)

if RenamedItem['File Extension'] contains "mp3" {
	saveFilePrompt(RenamedItem)
} else {
	savePhoto(RenamedItem)
}
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Advertisement

You Might Also Like

See All
Advertisement