import os

from selenium import webdriver

## This program is meant to to complement youtube-dl, populating a text file with series episode links. It is also specifically for use with Crunchyroll and because using series links leads to near 100% errors when trying to download. Using episode links sidesteps this problem and never (for me anyways) led to errors.

## Enables headless operation
fireFoxOptions = webdriver.FirefoxOptions()
fireFoxOptions.set_headless()

##list of all series main pages to scrape episode links from
## Note: I'm going to get rid of this in future updates relying strictly on a text file for this to work
cvl = [
    'https://www.crunchyroll.com/a-bridge-to-the-starry-skies-hoshizora-e-kakaru-hashi',
    'https://www.crunchyroll.com/a-certain-magical-index',
    'https://www.crunchyroll.com/a-certain-scientific-railgun',
    'https://www.crunchyroll.com/a-certain-scientific-accelerator',
    'https://www.crunchyroll.com/a-destructive-god-sits-next-to-me',
    'https://www.crunchyroll.com/a-good-librarian-like-a-good-shepherd',
    'https://www.crunchyroll.com/a-lull-in-the-sea-nagi-asu-nagi-no-asukara',
    'https://www.crunchyroll.com/a-sisters-all-you-need',
    'https://www.crunchyroll.com/a-town-where-you-live',
    'https://www.crunchyroll.com/accel-world',
    'https://www.crunchyroll.com/accel-world-infinite-burst',
    'https://www.crunchyroll.com/ahiru-no-sora',
    'https://www.crunchyroll.com/akame-ga-kill',
    'https://www.crunchyroll.com/akashic-records-of-bastard-magic-instructor',
    'https://www.crunchyroll.com/akibas-trip-the-animation',
    'https://www.crunchyroll.com/amagi-brilliant-park',
    'https://www.crunchyroll.com/angels-of-death',
    'https://www.crunchyroll.com/ange-vierge',
    'https://www.crunchyroll.com/anime-azurlane-slow-ahead',
    'https://www.crunchyroll.com/anohana-the-flower-we-saw-that-day',
    'https://www.crunchyroll.com/anohana-the-flower-we-saw-that-day-drama',
    'https://www.crunchyroll.com/another',
    'https://www.crunchyroll.com/ao-chan-cant-study',
    'https://www.crunchyroll.com/are-you-lost',
    'https://www.crunchyroll.com/armor-shop-for-ladies-gentlemen',
    'https://www.crunchyroll.com/ascendance-of-a-bookworm',
    'https://www.crunchyroll.com/asobi-asobase-workshop-of-fun-',
    'https://www.crunchyroll.com/assassins-pride',
    'https://www.crunchyroll.com/attack-on-titan',
    'https://www.crunchyroll.com/attack-on-titan-junior-high',
    'https://www.crunchyroll.com/bakemonogatari',
    'https://www.crunchyroll.com/bananya',
    'https://www.crunchyroll.com/bang-dream',
    'https://www.crunchyroll.com/battle-game-in-5-seconds',
    'https://www.crunchyroll.com/beyond-the-boundary',
    'https://www.crunchyroll.com/berserk',
    'https://www.crunchyroll.com/black-bullet',
    'https://www.crunchyroll.com/black-butler',
    'https://www.crunchyroll.com/black-butler-season-2',
    'https://www.crunchyroll.com/black-butler-book-of-circus',
    'https://www.crunchyroll.com/black-clover',
    'https://www.crunchyroll.com/blade-and-soulam',
    'https://www.crunchyroll.com/bleach',
    'https://www.crunchyroll.com/blend-s',
    'https://www.crunchyroll.com/blood-blockade-battlefront',
    'https://www.crunchyroll.com/blue-exorcist',
    'https://www.crunchyroll.com/blue-spring-ride',
    'https://www.crunchyroll.com/boruto-naruto-next-generations',
    'https://www.crunchyroll.com/brave-10',
    'https://www.crunchyroll.com/brotherhood-final-fantasy-xv',
    'https://www.crunchyroll.com/brynhildr-in-the-darkness',
    'https://www.crunchyroll.com/burn-the-witch',
    'https://www.crunchyroll.com/cardcaptor-sakura',
    'https://www.crunchyroll.com/cardcaptor-sakura-clear-card',
    'https://www.crunchyroll.com/cardcaptor-sakura-the-movie',
    'https://www.crunchyroll.com/cardcaptor-sakura-the-movie-2-the-sealed-card',
    'https://www.crunchyroll.com/cells-at-work',
    'https://www.crunchyroll.com/cells-at-work-code-black',
    'https://www.crunchyroll.com/ceres-celestial-legend',
    'https://www.crunchyroll.com/chain-chronicle-the-light-of-haecceitas-',
    'https://www.crunchyroll.com/campione',
    'https://www.crunchyroll.com/chaoschild',
    'https://www.crunchyroll.com/chaoshead',
    'https://www.crunchyroll.com/cherry-magic-thirty-years-of-virginity-can-make-you-a-wizard',
    'https://www.crunchyroll.com/chihayafuru',
    'https://www.crunchyroll.com/chis-sweet-home-chis-new-address',
    'https://www.crunchyroll.com/chronos-ruler',
    'https://www.crunchyroll.com/citrus',
    'https://www.crunchyroll.com/classroom-of-the-elite',
    'https://www.crunchyroll.com/clockwork-planet',
    'https://www.crunchyroll.com/conception',
    'https://www.crunchyroll.com/crossing-time',
    'https://www.crunchyroll.com/dakaichi-im-being-harassed-by-the-sexiest-man-of-the-year-',
    'https://www.crunchyroll.com/death-march-to-the-parallel-world-rhapsody',
    'https://www.crunchyroll.com/death-note',
    'https://www.crunchyroll.com/demon-king-daimao',
    'https://www.crunchyroll.com/demon-slayer-kimetsu-no-yaiba',
    'https://www.crunchyroll.com/devil-may-cry',
    'https://www.crunchyroll.com/devil-survivor-2-the-animation',
    'https://www.crunchyroll.com/diabolik-lovers',
    'https://www.crunchyroll.com/diabolik-lovers-moreblood',
    'https://www.crunchyroll.com/didnt-i-say-to-make-my-abilities-average-in-the-next-life',
    'https://www.crunchyroll.com/dies-irae',
    'https://www.crunchyroll.com/digimon-adventure',
    'https://www.crunchyroll.com/digimon-adventure-02',
    'https://www.crunchyroll.com/digimon-adventure-2020',
    'https://www.crunchyroll.com/digimon-adventure-tri',
    'https://www.crunchyroll.com/digimon-frontier',
    'https://www.crunchyroll.com/digimon-tamers',
    'https://www.crunchyroll.com/digimon-universe-app-monsters',
    'https://www.crunchyroll.com/disgaea',
    'https://www.crunchyroll.com/dogezai-tried-asking-while-kowtowing',
    'https://www.crunchyroll.com/domestic-girlfriend',
    'https://www.crunchyroll.com/dont-toy-with-me-miss-nagatoro',
    'https://www.crunchyroll.com/do-you-love-your-mom-and-her-two-hit-multi-target-attacks',
    'https://www.crunchyroll.com/dr-ramune-mysterious-disease-specialist-',
    'https://www.crunchyroll.com/dr-stone',
    'https://www.crunchyroll.com/dragon-age-dawn-of-the-seeker',
    'https://www.crunchyroll.com/dragon-ball-super',
    'https://www.crunchyroll.com/dragon-crisis',
    'https://www.crunchyroll.com/dragon-quest-the-adventure-of-dai',
    'https://www.crunchyroll.com/dropkick-on-my-devil-dash',
    'https://www.crunchyroll.com/drug-store-in-another-world-the-slow-life-of-a-cheat-pharmacist',
    'https://www.crunchyroll.com/elegant-yokai-apartment-life',
    'https://www.crunchyroll.com/elemental-gelade',
    'https://www.crunchyroll.com/erased',
    'https://www.crunchyroll.com/eromanga-sensei',
    'https://www.crunchyroll.com/ex-arm',
    'https://www.crunchyroll.com/fairy-tail',
    'https://www.crunchyroll.com/familiar-of-zero-f',
    'https://www.crunchyroll.com/fatal-fury-ova',
    'https://www.crunchyroll.com/fatal-fury-the-motion-picture',
    'https://www.crunchyroll.com/fategrand-order-first-order',
    'https://www.crunchyroll.com/fategrand-order-first-order/fategrand-order-first-order-fate-grand-order-first-order-728169',
    'https://www.crunchyroll.com/fategrand-order-moonlightlostroom-',
    'https://www.crunchyroll.com/fategrand-order-absolute-demonic-front-babylonia',
    'https://www.crunchyroll.com/fatestay-night',
    'https://www.crunchyroll.com/fatezero',
    'https://www.crunchyroll.com/fatekaleid-liner-prisma-illya',
    'https://www.crunchyroll.com/final-fantasy-xv-episode-ardyn-prologue',
    'https://www.crunchyroll.com/fire-force',
    'https://www.crunchyroll.com/food-wars-shokugeki-no-soma',
    'https://www.crunchyroll.com/for-whom-the-alchemist-exists-the-movie',
    'https://www.crunchyroll.com/fruits-basket',
    'https://www.crunchyroll.com/fullmetal-alchemist-brotherhood',
    'https://www.crunchyroll.com/fullmetal-alchemist-the-conqueror-of-shamballa',
    'https://www.crunchyroll.com/full-metal-panic',
    'https://www.crunchyroll.com/full-metal-panic-fumoffu',
    'https://www.crunchyroll.com/full-metal-panic-the-second-raid',
    'https://www.crunchyroll.com/full-metal-panic-invisible-victory',
    'https://www.crunchyroll.com/fuuka',
    'https://www.crunchyroll.com/gamers',
    'https://www.crunchyroll.com/gantz',
    'https://www.crunchyroll.com/garakowa-restore-the-world-',
    'https://www.crunchyroll.com/gate',
    'https://www.crunchyroll.com/genshiken-second-season',
    'https://www.crunchyroll.com/gibiate',
    'https://www.crunchyroll.com/girly-air-force',
    'https://www.crunchyroll.com/gintama',
    'https://www.crunchyroll.com/girlfriend-girlfriend',
    'https://www.crunchyroll.com/given',
    'https://www.crunchyroll.com/goblin-slayer',
    'https://www.crunchyroll.com/god-eater',
    'https://www.crunchyroll.com/golden-kamuy',
    'https://www.crunchyroll.com/golden-time',
    'https://www.crunchyroll.com/grand-blues',
    'https://www.crunchyroll.com/granblue-fantasy-the-animation',
    'https://www.crunchyroll.com/grimgar-of-fantasy-and-ash',
    'https://www.crunchyroll.com/grimms-notes-the-animation',
    'https://www.crunchyroll.com/gundam-build-divers',
    'https://www.crunchyroll.com/gundam-build-fighters',
    'https://www.crunchyroll.com/gunslinger-stratos',
    'https://www.crunchyroll.com/guyver-the-bioboosted-armor',
    'https://www.crunchyroll.com/hackgu-trilogy',
    'https://www.crunchyroll.com/hacklegend-of-the-twilight',
    'https://www.crunchyroll.com/hackquantum',
    'https://www.crunchyroll.com/hackroots',
    'https://www.crunchyroll.com/hacksign',
    'https://www.crunchyroll.com/hakubo',
    'https://www.crunchyroll.com/haikyu',
    'https://www.crunchyroll.com/hajime-no-ippo-the-fighting',
    'https://www.crunchyroll.com/hamatora',
    'https://www.crunchyroll.com/hanasaku-iroha',
    'https://www.crunchyroll.com/hanebado',
    'https://www.crunchyroll.com/harukana-receive',
    'https://www.crunchyroll.com/hakata-tonkotsu-ramens',
    'https://www.crunchyroll.com/healin-good-pretty-cure',
    'https://www.crunchyroll.com/heavens-design-team',
    'https://www.crunchyroll.com/heavens-lost-property',
    'https://www.crunchyroll.com/hell-girl-fourth-twilight',
    'https://www.crunchyroll.com/high-school-dxd',
    'https://www.crunchyroll.com/high-school-fleet',
    'https://www.crunchyroll.com/high-school-prodigies-have-it-easy-even-in-another-world',
    'https://www.crunchyroll.com/himote-house-a-share-house-of-super-psychic-girls',
    'https://www.crunchyroll.com/hinamatsuri',
    'https://www.crunchyroll.com/hinomaru-sumo',
    'https://www.crunchyroll.com/hitori-no-shita-the-outcast',
    'https://www.crunchyroll.com/how-not-to-summon-a-demon-lord',
    'https://www.crunchyroll.com/hundred',
    'https://www.crunchyroll.com/idol-time-pripara',
    'https://www.crunchyroll.com/if-its-for-my-daughter-id-even-defeat-a-demon-lord',
    'https://www.crunchyroll.com/ikemen-sengoku-bromances-across-time',
    'https://www.crunchyroll.com/im-standing-on-a-million-lives',
    'https://www.crunchyroll.com/in-another-world-with-my-smartphone',
    'https://www.crunchyroll.com/infinite-stratos',
    'https://www.crunchyroll.com/inspectre',
    'https://www.crunchyroll.com/inuyasha',
    'https://www.crunchyroll.com/inuyasha-the-movie-affections-touching-across-time',
    'https://www.crunchyroll.com/inuyasha-the-movie-2-the-castle-beyond-the-looking-glass',
    'https://www.crunchyroll.com/inuyasha-the-movie-3-swords-of-an-honorable-ruler',
    'https://www.crunchyroll.com/inuyasha-the-movie-4-fire-on-the-mystic-island',
    'https://www.crunchyroll.com/isekai-izakaya-japanese-food-from-another-world',
    'https://www.crunchyroll.com/isekai-cheat-magician',
    'https://www.crunchyroll.com/isekai-quartet',
    'https://www.crunchyroll.com/island',
    'https://www.crunchyroll.com/is-it-wrong-to-try-to-pick-up-girls-in-a-dungeon',
    'https://www.crunchyroll.com/is-the-order-a-rabbit',
    'https://www.crunchyroll.com/ive-always-liked-you',
    'https://www.crunchyroll.com/iwakakeru-sport-climbing-girls-',
    'https://www.crunchyroll.com/izetta-the-last-witch',
    'https://www.crunchyroll.com/japanese-anime-classic-collection',
    'https://www.crunchyroll.com/joshi-kausei',
    'https://www.crunchyroll.com/jujutsu-kaisen',
    'https://www.crunchyroll.com/junji-ito-collection',
    'https://www.crunchyroll.com/juni-taisenzodiac-war',
    'https://www.crunchyroll.com/k',
    'https://www.crunchyroll.com/k-missing-kings',
    'https://www.crunchyroll.com/k-seven-stories',
    'https://www.crunchyroll.com/kaguya-sama-love-is-war',
    'https://www.crunchyroll.com/kamigami-no-asobi',
    'https://www.crunchyroll.com/kamisama-dolls',
    'https://www.crunchyroll.com/kamisama-hajimemashita',
    'https://www.crunchyroll.com/kanojo-ga-flag-wo-oraretara-if-her-flag-breaks',
    'https://www.crunchyroll.com/karakai-jozu-no-takagi-san',
    'https://www.crunchyroll.com/katana-maidens-mini-toji',
    'https://www.crunchyroll.com/katana-maidens-toji-no-miko',
    'https://www.crunchyroll.com/kaze-no-stigma',
    'https://www.crunchyroll.com/keijo',
    'https://www.crunchyroll.com/kimi-ni-todoke-from-me-to-you',
    'https://www.crunchyroll.com/kira-kirapretty-cure-a-la-mode',
    'https://www.crunchyroll.com/kiratto-prichan',
    'https://www.crunchyroll.com/kiss-him-not-me',
    'https://www.crunchyroll.com/knights-magic',
    'https://www.crunchyroll.com/koihime-musou',
    'https://www.crunchyroll.com/konosuba-gods-blessing-on-this-wonderful-world',
    'https://www.crunchyroll.com/kono-oto-tomare-sounds-of-life',
    'https://www.crunchyroll.com/koro-sensei-quest',
    'https://www.crunchyroll.com/kyousougiga',
    'https://www.crunchyroll.com/la-storia-della-arcana-famiglia',
    'https://www.crunchyroll.com/little-nemo-adventures-in-slumberland',
    'https://www.crunchyroll.com/log-horizon',
    'https://www.crunchyroll.com/looking-up-at-the-half-moon',
    'https://www.crunchyroll.com/lord-el-melloi-iis-case-files-rail-zeppelin-grace-note',
    'https://www.crunchyroll.com/lostorage-incited-wixoss',
    'https://www.crunchyroll.com/love-chunibyo-other-delusions',
    'https://www.crunchyroll.com/love-chunibyo-other-delusions-heart-throb-',
    'https://www.crunchyroll.com/love-hina-again',
    'https://www.crunchyroll.com/love-live-school-idol-project',
    'https://www.crunchyroll.com/love-live-sunshine',
    'https://www.crunchyroll.com/love-to-lie-angle',
    'https://www.crunchyroll.com/magi',
    'https://www.crunchyroll.com/magikano',
    'https://www.crunchyroll.com/magical-girl-spec-ops-asuka',
    'https://www.crunchyroll.com/magical-sempai',
    'https://www.crunchyroll.com/magical-warfare',
    'https://www.crunchyroll.com/maoyu',
    'https://www.crunchyroll.com/masamune-kuns-revenge',
    'https://www.crunchyroll.com/medaka-box',
    'https://www.crunchyroll.com/meiji-tokyo-renka',
    'https://www.crunchyroll.com/million-arthur',
    'https://www.crunchyroll.com/mobile-fighter-g-gundam',
    'https://www.crunchyroll.com/mobile-suit-gundam-00',
    'https://www.crunchyroll.com/mobile-suit-gundam-iron-blooded-orphans',
    'https://www.crunchyroll.com/mobile-suit-gundam-unicorn-re0096',
    'https://www.crunchyroll.com/mobile-suit-gundam-seed',
    'https://www.crunchyroll.com/mobile-suit-gundam-seed-destiny',
    'https://www.crunchyroll.com/mobile-suit-gundam-the-origin-advent-of-the-red-comet',
    'https://www.crunchyroll.com/mobile-suit-gundam-wing',
    'https://www.crunchyroll.com/mobile-suit-gundam-wing-endless-waltz',
    'https://www.crunchyroll.com/mobile-suit-gundam-unicorn-re0096',
    'https://www.crunchyroll.com/mon-colle-knights',
    'https://www.crunchyroll.com/mononoke',
    'https://www.crunchyroll.com/monogatari-second-season',
    'https://www.crunchyroll.com/monster-girl-doctor',
    'https://www.crunchyroll.com/monster-musume-everyday-life-with-monster-girls',
    'https://www.crunchyroll.com/monthly-girls-nozaki-kun',
    'https://www.crunchyroll.com/moritasan-wa-mukuchi',
    'https://www.crunchyroll.com/motto-to-love-ru',
    'https://www.crunchyroll.com/mr-love-queens-choice',
    'https://www.crunchyroll.com/muhyo-rojis-bureau-of-supernatural-investigation',
    'https://www.crunchyroll.com/music-girls',
    'https://www.crunchyroll.com/my-first-girlfriend-is-a-gal',
    'https://www.crunchyroll.com/my-hero-academia',
    'https://www.crunchyroll.com/my-little-monster',
    'https://www.crunchyroll.com/my-love-story',
    'https://www.crunchyroll.com/my-mental-choices-are-completely-interfering-with-my-school-romantic-comedy',
    'https://www.crunchyroll.com/my-next-life-as-a-villainess-all-routes-lead-to-doom',
    'https://www.crunchyroll.com/my-roommate-is-a-cat',
    'https://www.crunchyroll.com/my-teen-romantic-comedy-snafu',
    'https://www.crunchyroll.com/my-wife-is-the-student-council-president?skip_wall=1',
    'https://www.crunchyroll.com/mysterious-girlfriend-x',
    'https://www.crunchyroll.com/nagi-no-asukara-nagi-asu-a-lull-in-the-sea',
    'https://www.crunchyroll.com/nananas-buried-treasure',
    'https://www.crunchyroll.com/naruto',
    'https://www.crunchyroll.com/naruto-the-movie-legend-of-the-stone-of-gelel',
    'https://www.crunchyroll.com/naruto-the-movie-ninja-clash-in-the-land-of-snow',
    'https://www.crunchyroll.com/naruto-shippuden',
    'https://www.crunchyroll.com/naruto-the-movie-guardians-of-the-crescent-moon-kingdom',
    'https://www.crunchyroll.com/naruto-shippuden-the-movie-the-will-of-fire',
    'https://www.crunchyroll.com/naruto-shippuden-the-movie-the-lost-tower',
    'https://www.crunchyroll.com/naruto-shippuden-the-movie-blood-prison',
    'https://www.crunchyroll.com/natsume-yujin-cho',
    'https://www.crunchyroll.com/natsume-yujin-cho-4',
    'https://www.crunchyroll.com/natsume-yujin-cho-5',
    'https://www.crunchyroll.com/natsume-yujin-cho-6',
    'https://www.crunchyroll.com/nekomonogatari-black',
    'https://www.crunchyroll.com/netsuzou-trap-ntr-',
    'https://www.crunchyroll.com/night-head-2041',
    'https://www.crunchyroll.com/nisekoi',
    'https://www.crunchyroll.com/nisemonogatari',
    'https://www.crunchyroll.com/ninja-collection',
    'https://www.crunchyroll.com/noblesse',
    'https://www.crunchyroll.com/noblesse-awakening',
    'https://www.crunchyroll.com/nobunaga-teachers-young-bride',
    'https://www.crunchyroll.com/no-game-no-life',
    'https://www.crunchyroll.com/non-non-biyori',
    'https://www.crunchyroll.com/oda-cinnamon-nobunaga',
    'https://www.crunchyroll.com/one-piece',
    'https://www.crunchyroll.com/one-punch-man',
    'https://www.crunchyroll.com/oneroom',
    'https://www.crunchyroll.com/onimusha-dawn-of-dreams',
    'https://www.crunchyroll.com/orange',
    'https://www.crunchyroll.com/oreshura',
    'https://www.crunchyroll.com/oresuki-are-you-the-only-one-who-loves-me	',
    'https://www.crunchyroll.com/ouran-high-school-host-club',
    'https://www.crunchyroll.com/our-love-has-always-been-10-centimeters-apart',
    'https://www.crunchyroll.com/oreimo',
    'https://www.crunchyroll.com/overlord',
    'https://www.crunchyroll.com/owarimonogatari',
    'https://www.crunchyroll.com/peach-boy-riverside',
    'https://www.crunchyroll.com/peter-grill-and-the-philosophers-time',
    'https://www.crunchyroll.com/persona4-the-golden-animation',
    'https://www.crunchyroll.com/persona5-the-animation',
    'https://www.crunchyroll.com/persona5-the-animation-the-day-breakers-',
    'https://www.crunchyroll.com/phantasy-star-online-2-the-animation',
    'https://www.crunchyroll.com/phantom-in-the-twilight',
    'https://www.crunchyroll.com/phantom-requiem-for-the-phantom',
    'https://www.crunchyroll.com/pretty-cure',
    'https://www.crunchyroll.com/princess-connect-re-dive',
    'https://www.crunchyroll.com/psychic-princess',
    'https://www.crunchyroll.com/radiant',
    'https://www.crunchyroll.com/rail-romanesque',
    'https://www.crunchyroll.com/rainy-cocoa',
    'https://www.crunchyroll.com/rainy-cocoa-sideg',
    'https://www.crunchyroll.com/ramen-fighter-miki',
    'https://www.crunchyroll.com/rascal-does-not-dream-of-bunny-girl-senpai',
    'https://www.crunchyroll.com/re-kan',
    'https://www.crunchyroll.com/record-of-lodoss-war',
    'https://www.crunchyroll.com/record-of-grancrest-war',
    'https://www.crunchyroll.com/recorder-and-randsell',
    'https://www.crunchyroll.com/recovery-of-an-mmo-junkie',
    'https://www.crunchyroll.com/relife',
    'https://www.crunchyroll.com/remake-our-life',
    'https://www.crunchyroll.com/rent-a-girlfriend',
    'https://www.crunchyroll.com/rezero-starting-life-in-another-world-',
    'https://www.crunchyroll.com/rezero-starting-life-in-another-world-shorts',
    'https://www.crunchyroll.com/road-to-ninja-naruto-the-movie',
    'https://www.crunchyroll.com/rokka-braves-of-the-six-flowers-',
    'https://www.crunchyroll.com/rosario-vampire',
    'https://www.crunchyroll.com/rozen-maiden',
    'https://www.crunchyroll.com/rozen-maiden-zurckspulen',
    'https://www.crunchyroll.com/run-with-the-wind',
    'https://www.crunchyroll.com/rurouni-kenshin',
    'https://www.crunchyroll.com/rwby',
    'https://www.crunchyroll.com/sabagebu-survival-game-club-',
    'https://www.crunchyroll.com/saekano-how-to-raise-a-boring-girlfriend-',
    'https://www.crunchyroll.com/saga-of-tanya-the-evil',
    'https://www.crunchyroll.com/sailor-moon-crystal',
    'https://www.crunchyroll.com/sailor-moon-r-the-movie',
    'https://www.crunchyroll.com/sailor-moon-r-the-movie/sailor-moon-r-the-movie-sailor-moon-r-the-movie-dub-791726',
    'https://www.crunchyroll.com/sailor-moon-r-the-movie/sailor-moon-r-the-movie-sailor-moon-r-the-movie-sub-791725',
    'https://www.crunchyroll.com/saint-seiya',
    'https://www.crunchyroll.com/saint-seiya-hades',
    'https://www.crunchyroll.com/saint-seiya-hades-en',
    'https://www.crunchyroll.com/saint-seiya-omega',
    'https://www.crunchyroll.com/saint-seiya-saintia-sho',
    'https://www.crunchyroll.com/saint-seiya-sanctuary',
    'https://www.crunchyroll.com/saint-seiya-soul-of-gold',
    'https://www.crunchyroll.com/saint-seiya-the-lost-canvas',
    'https://www.crunchyroll.com/samurai-pizza-cats',
    'https://www.crunchyroll.com/samurai-warriors',
    'https://www.crunchyroll.com/say-i-love-you',
    'https://www.crunchyroll.com/science-fell-in-love-so-i-tried-to-prove-it',
    'https://www.crunchyroll.com/sd-gundam-world-sangoku-soketsuden',
    'https://www.crunchyroll.com/seirei-gensouki-spirit-chronicles',
    'https://www.crunchyroll.com/sengoku-basara-samurai-kings',
    'https://www.crunchyroll.com/sengoku-basara-end-of-judgement',
    'https://www.crunchyroll.com/sengoku-collection-parallel-world-samurai',
    'https://www.crunchyroll.com/sengoku-night-blood',
    'https://www.crunchyroll.com/sengokuchojyugiga',
    'https://www.crunchyroll.com/servant-x-service',
    'https://www.crunchyroll.com/seven-mortal-sins',
    'https://www.crunchyroll.com/shadowverse',
    'https://www.crunchyroll.com/shin-koihime-musou',
    'https://www.crunchyroll.com/shin-koihime-musou-otome-tairan',
    'https://www.crunchyroll.com/shining-tears-x-wind',
    'https://www.crunchyroll.com/shirobako',
    'https://www.crunchyroll.com/showa-genroku-rakugo-shinju',
    'https://www.crunchyroll.com/snack-world',
    'https://www.crunchyroll.com/so-im-a-spider-so-what',
    'https://www.crunchyroll.com/soul-eater-not',
    'https://www.crunchyroll.com/sound-euphonium',
    'https://www.crunchyroll.com/stairway-to-heaven',
    'https://www.crunchyroll.com/starlight-promises',
    'https://www.crunchyroll.com/steinsgate',
    'https://www.crunchyroll.com/steinsgate-0',
    'https://www.crunchyroll.com/street-fighter-ii-the-animated-series',
    'https://www.crunchyroll.com/street-fighter-ii-the-animated-movie',
    'https://www.crunchyroll.com/strike-the-blood',
    'https://www.crunchyroll.com/sword-art-online',
    'https://www.crunchyroll.com/sword-art-online-alternative-gun-gale-online',
    'https://www.crunchyroll.com/sunday-without-god',
    'https://www.crunchyroll.com/symphogear',
    'https://www.crunchyroll.com/taboo-tattoo',
    'https://www.crunchyroll.com/tales-of-crestoria-the-wake-of-sin-',
    'https://www.crunchyroll.com/tama-of-the-3rd-district-have-you-seen-my-tama',
    'https://www.crunchyroll.com/tamayura-hitotose',
    'https://www.crunchyroll.com/tari-tari',
    'https://www.crunchyroll.com/tenjho-tenge',
    'https://www.crunchyroll.com/that-time-i-got-reincarnated-as-a-slime',
    'https://www.crunchyroll.com/the-8th-son-are-you-kidding-me',
    'https://www.crunchyroll.com/the-ambition-of-oda-nobuna',
    'https://www.crunchyroll.com/the-ancient-magus-bride',
    'https://www.crunchyroll.com/the-asterisk-war',
    'https://www.crunchyroll.com/the-aquatope-on-white-sand',
    'https://www.crunchyroll.com/the-eccentric-family',
    'https://www.crunchyroll.com/the-eccentric-family-2',
    'https://www.crunchyroll.com/the-garden-of-sinners',
    'https://www.crunchyroll.com/the-god-of-high-school',
    'https://www.crunchyroll.com/the-great-jahy-will-not-be-defeated',
    'https://www.crunchyroll.com/the-hidden-dungeon-only-i-can-enter',
    'https://www.crunchyroll.com/the-idolmster-cinderella-girls',
    'https://www.crunchyroll.com/the-idolmster-cinderella-girls-theater',
    'https://www.crunchyroll.com/the-idolmster-side-m',
    'https://www.crunchyroll.com/the-idolmster-sidem-wakeatte-mini',
    'https://www.crunchyroll.com/the-irregular-at-magic-high-school',
    'https://www.crunchyroll.com/the-last-naruto-the-movie',
    'https://www.crunchyroll.com/the-master-of-ragnarok-blesser-of-einherjar',
    'https://www.crunchyroll.com/the-misfit-of-demon-king-academy',
    'https://www.crunchyroll.com/the-quintessential-quintuplets',
    'https://www.crunchyroll.com/the-rising-of-the-shield-hero',
    'https://www.crunchyroll.com/the-silver-guardian',
    'https://www.crunchyroll.com/the-testament-of-sister-new-devil',
    'https://www.crunchyroll.com/the-ultimatum',
    'https://www.crunchyroll.com/the-world-god-only-knows',
    'https://www.crunchyroll.com/the-world-is-still-beautiful',
    'https://www.crunchyroll.com/the-world-yamizukan',
    'https://www.crunchyroll.com/to-be-hero',
    'https://www.crunchyroll.com/to-be-heroine',
    'https://www.crunchyroll.com/trinity-seven',
    'https://www.crunchyroll.com/todays-menu-for-the-emiya-family',
    'https://www.crunchyroll.com/to-love-ru',
    'https://www.crunchyroll.com/to-love-ru-darkness',
    'https://www.crunchyroll.com/tokyo-revengers',
    'https://www.crunchyroll.com/tonikawa-over-the-moon-for-you',
    'https://www.crunchyroll.com/toradora',
    'https://www.crunchyroll.com/tower-of-god',
    'https://www.crunchyroll.com/triage-x',
    'https://www.crunchyroll.com/tropical-rouge-precure',
    'https://www.crunchyroll.com/true-cooking-master-boy',
    'https://www.crunchyroll.com/tsugumomo',
    'https://www.crunchyroll.com/tsukimichi-moonlit-fantasy-',
    'https://www.crunchyroll.com/tsukimonogatari',
    'https://www.crunchyroll.com/tsuredure-children',
    'https://www.crunchyroll.com/tsurune',
    'https://www.crunchyroll.com/twin-angels-break',
    'https://www.crunchyroll.com/ultraman-gaia',
    'https://www.crunchyroll.com/ultraman-geed',
    'https://www.crunchyroll.com/ultraman-ginga',
    'https://www.crunchyroll.com/ultraman-nexus',
    'https://www.crunchyroll.com/ultraman-orb',
    'https://www.crunchyroll.com/ultraman-x',
    'https://www.crunchyroll.com/ulysses-jeanne-darc-and-the-alchemist-knight',
    'https://www.crunchyroll.com/umamusume-pretty-derby',
    'https://www.crunchyroll.com/umi-monogatari',
    'https://www.crunchyroll.com/urusei-yatsura-movies',
    'https://www.crunchyroll.com/wagnaria',
    'https://www.crunchyroll.com/wake-up-girls',
    'https://www.crunchyroll.com/wanna-be-the-strongest-in-the-world',
    'https://www.crunchyroll.com/wave-lets-go-surfing-',
    'https://www.crunchyroll.com/welcome-to-demon-school-iruma-kun',
    'https://www.crunchyroll.com/we-never-learn-bokuben',
    'https://www.crunchyroll.com/we-rent-tsukumogami',
    'https://www.crunchyroll.com/when-supernatural-battles-became-commonplace',
    'https://www.crunchyroll.com/white-album',
    'https://www.crunchyroll.com/white-album-2',
    'https://www.crunchyroll.com/why-the-hell-are-you-here-teacher',
    'https://www.crunchyroll.com/wise-mans-grandchild',
    'https://www.crunchyroll.com/with-a-dog-and-a-cat-every-day-is-fun',
    'https://www.crunchyroll.com/wixoss-divaalive',
    'https://www.crunchyroll.com/world-break-aria-of-curse-for-a-holy-swordsman',
    'https://www.crunchyroll.com/world-conquest-zvezda-plot',
    'https://www.crunchyroll.com/worldend-what-do-you-do-at-the-end-of-the-world-are-you-busy-will-you-save-us',
    'https://www.crunchyroll.com/world-trigger',
    'https://www.crunchyroll.com/wwwwagnaria',
    'https://www.crunchyroll.com/yamada-kun-and-the-seven-witches',
    'https://www.crunchyroll.com/yamibo-darkness-the-hat-and-travelers-of-the-books',
    'https://www.crunchyroll.com/yamishibai-japanese-ghost-stories',
    'https://www.crunchyroll.com/yashahime-princess-half-demon',
    'https://www.crunchyroll.com/yona-of-the-dawn',
    'https://www.crunchyroll.com/you-and-me',
    'https://www.crunchyroll.com/you-and-me-2',
    'https://www.crunchyroll.com/your-lie-in-april',
    'https://www.crunchyroll.com/yu-gi-oh',
    'https://www.crunchyroll.com/yu-gi-oh-arc-v',
    'https://www.crunchyroll.com/yu-gi-oh-gx',
    'https://www.crunchyroll.com/yu-gi-oh-5ds',
    'https://www.crunchyroll.com/yu-gi-oh-zexal',
    'https://www.crunchyroll.com/yu-gi-oh-vrains',
    'https://www.crunchyroll.com/yuki-yuna-is-a-hero',
    'https://www.crunchyroll.com/yu-no-a-girl-who-chants-love-at-the-bound-of-this-world',
    'https://www.crunchyroll.com/yuuna-and-the-haunted-hot-springs',
    'https://www.crunchyroll.com/zombie-land-saga'
]
current_episode = []
crunchyroll_series = 'crunchyroll_series_list.txt'
crel = 'cr_episode_list.txt'

if not crel in os.listdir():
    open(crel, 'w')
episode_list = open(crel, 'r')
for s in episode_list.readlines():
    current_episode.append(s)

## Use this section of code to make sure that your file is read and appended to current_episode before you run the code to prevent duplicate entries.
# current_episode = 
# for e in current_episode:
#     print(e)
# quit()

with webdriver.Firefox(options=fireFoxOptions) as driver:
    count = 0
    for series in cvl:
        driver.get(cvl[count])

        ## Gets all links inside .episode which are the episode links including all dubbed versions
        starts = driver.find_elements_by_class_name('episode')        
        for start in starts:

            ## looks in each a tag for href attribute
            end = start.get_attribute('href')
            
            ## Prevents writing duplicate links by checking current_episode list for it
            if end + '\n' in current_episode:
                print('[archived]', end)
                continue

            ## If attribute = none then navigate to next series
            elif start.get_attribute('href') == None:
                print('2[NONE]', end)
                break

            ## Note: entries will not appear in archive until program is complete
            ## If attribute is an episode link then print and write to cvel
            elif end.startswith(cvl[count] + '/episode'):
                episode_list = open(crel, 'a')
                episode_list.write(end + '\n')
                print('5', end)
                
        ## Incrementing begins next series to load
        count+=1
    driver.quit
    quit()
    