Greasy Fork镜像 支持简体中文。

Apple Podcasts URLs

Extract and copy all episode URLs from Apple Podcasts to clipboard for pasting into yt-dlp

  1. // ==UserScript==
  2. // @name Apple Podcasts URLs
  3. // @description Extract and copy all episode URLs from Apple Podcasts to clipboard for pasting into yt-dlp
  4. // @match https://podcasts.apple.com/*/podcast/*/id*
  5. // @license Apache-2.0
  6. // @version 0.0.1.20250213205050
  7. // @namespace https://gf.qytechs.cn/users/1128769
  8. // ==/UserScript==
  9.  
  10. // Select the node that will be observed for mutations
  11. const targetNode = document.querySelector('.content-container')
  12.  
  13. // Options for the observer (which mutations to observe)
  14. const config = { attributes: false, childList: true, subtree: false }
  15.  
  16. // Callback function to execute when mutations are observed
  17. const callback = (mutationList, observer) => {
  18. loaded = document.querySelectorAll('.episode')
  19. if (typeof total !== 'undefined' && loaded.length < total)
  20. document
  21. .querySelector('#scrollable-page')
  22. .scrollTo(0, targetNode.scrollHeight)
  23. else {
  24. urls = [...loaded].map(e => e.querySelector('a').href).join(' ')
  25. console.log(urls)
  26. alert(urls)
  27. navigator.clipboard.write([new ClipboardItem({ 'text/plain': urls })])
  28. }
  29. }
  30.  
  31. // Create an observer instance linked to the callback function
  32. const observer = new MutationObserver(callback)
  33.  
  34. window.onload = event => {
  35. btn = document.querySelector(`a[href*="/podcast/id"]`)
  36. if (btn) {
  37. total = parseInt(btn.text.replace(/\D/g, ''))
  38. btn.click()
  39.  
  40. // Start observing the target node for configured mutations
  41. observer.observe(targetNode, config)
  42. } else callback()
  43. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址