youtube.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. const youtube = {
  2. name: 'YouTube',
  3. empty: 'hiker://empty',
  4. d: [],
  5. plugins: {
  6. channels: "hiker://files/rules/js/TyrantGenesis_YouTube-Channels.js",
  7. keyPath: "hiker://files/rules/js/TyrantGenesis_YouTube-api-key.js",
  8. },
  9. defaultChannels: [
  10. {
  11. title: 'J. Cole',
  12. channelId: 'UCnc6db-y3IU7CkT_yeVXdVg',
  13. icon: 'https://yt3.ggpht.com/ytc/AAUvwniDYxWC2x4VZF7ecutGEaLpssNmrptdeuVFJI999g=s88-c-k-c0x00ffffff-no-rj-mo',
  14. },
  15. {
  16. title: 'Lofi Girl',
  17. channelId: 'UCSJ4gkVC6NrvII8umztf0Ow',
  18. icon: 'https://yt3.ggpht.com/ytc/AAUvwnhGIymQGp3jRMECbTCBSRAUqi8sKbATpWowQG44CA=s88-c-k-c0x00ffffff-no-rj',
  19. },
  20. {
  21. title: 'HatsuneMiku',
  22. channelId: 'UCJwGWV914kBlV4dKRn7AEFA',
  23. icon: 'https://yt3.ggpht.com/ytc/AAUvwnjlsiW6yKsmkrfqn2foSm-ONTTWLeK_G70PF6TXBg=s800-c-k-c0x00ffffff-no-rj-mo',
  24. }
  25. ],
  26. defaultKey: 'AIzaSyDAVB60lCVpHO0nnsWyGtDWC9DTxH8vWlg',
  27. channelSelect: setItem('YouTube.channelSelect', '0'),
  28. homePageToken: setItem('YouTube.homePageToken', ''),
  29. pluginsInit: () => {
  30. const channels = fetch(youtube.plugins.channels)
  31. const key = fetch(youtube.plugins.keyPath)
  32. if (! channels) {
  33. const defaultChannels = youtube.defaultChannels.map(channel => channel.title+'$$$'+channel.channelId+'$$$'+channel.icon).join('\n')
  34. writeFile(youtube.plugins.channels, defaultChannels)
  35. }
  36. if (! key) {
  37. writeFile(youtube.plugins.keyPath, youtube.defaultKey)
  38. }
  39. },
  40. baseParse: () => {
  41. setResult(youtube.d)
  42. },
  43. }
  44. $.exports = youtube