Initial commit

This commit is contained in:
MineRobber9000 2018-08-02 23:39:56 -04:00
commit 84a282fb8a
3 changed files with 214 additions and 0 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# EpisodeGen
Generates incorrect quotes from Steven Universe episodes. Could be strung together to make the dialogue for an entire episode, as
the name implies.
Currently, I'm working on getting all of the transcripts I can.
Uses markovify.
Everything I have power to license in this project is licensed under MIT.

163
corpora/reunited.txt Normal file
View File

@ -0,0 +1,163 @@
You nervous?
I'm not.
Flowers for you! Flowers for you!
Wedding commander, all flowers have been deployed!
Thanks, Peridot.
other favorite people. You all probably know her as Garnet. She's their love, given form, now it's your turn to talk about that.
I know this is all kind of silly, I mean, we've been together for 5,750 years.
And 8 months.
I used to feel like I wasn't much good, just one of me on my own, but when we're together, it feels like it's okay to just be me. So I wanna be me, with you, and, and, not even the Diamonds will come between us. And if they try, we'll beat em up! (''punches and kicks furiously into the air'')
my future used to look like one single, obvious stream, unbending 'til the end of time. In an instant, you pulled me from that destiny, and opened my eye to an explosion of infinite possible futures, streaking across space and time, altered and obliterated by the smallest force of will.
What I mean is, you changed my life. And then, I changed your life. And now, we changed our lives.
Bismuth, the rings.
Hey Bismuth, that's your cue.
Ruby, do you take this gem to have and to hold on this and every other planet in the universe?
I do!
And Sapphire, do you...
Yes.
You didn't let me finish.
I'm just very excited.
Then by the power vested in me by the state of Delmarva, I now pronounce you... Garnet!
Steven!
Hey Garnet!
Thanks for everything. I needed this.
What a wonderful idea. Humans found a way to make a moment's decision last forever. I won't need future vision to know I'll always remember this.
I'm so glad!
Oh no! I'm sorry. Don't cry.
I guess seeing everyone together got me really choked up. Wait a second, you don't think...?
Blue Diamond!
She's here?!
And she's not alone.
Oh no. It's the Diamonds!
Nanefua, get on your Nane-phone! We've got a Code Blue and a Code Yellow!
This is it.
We're over here, you clods!
Where are they going?
They're not here for us. They must be here for the Cluster.
What's the Cluster?!
It's a huge Earth-destroying geo-weapon that the Diamonds made out of a bajillion gem shards.
I gotta keep it calm and in its bubble. I can use my mind to connect with it but only when I'm asleep.
Asleep?!
It's no use! How am I supposed to sleep through this?!
Maybe a lullaby will help.
Uh, I'm not sure this is gonna...
The Cluster! Stay calm. Try to keep from forming.
No, no, no, no, no, no, no, noooo! It popped!
Attention, citizens of Beach City. Everyone, head to your designated shelters. I repeat, this is not a drill! Get yourselves over to the shelters.
Alright, looks like it's in control of itself, and it's on our side.
Go Cluster, go!
Blue Diamond!
I guess it's time to work the old Universe charm.
No!
Alright, I'll just be in here.
Rose Quartz. So you escaped Homeworld and crawled back here. This is Pink's world! How dare you use it as your hiding place! Come! Answer for what you've done!
This is bad! This is bad! This is bad! This is bad!!!
Come on, you rocks! Let's put her in a bubble!
Right!
Wait, there's no reason to fight. Let me talk to her. Blue Diamond, please listen to me. I didn't shatter Pink Diamond. Pink Diamond's right here. It's pretty interesting when you think about it.
Enough!
Wait!
You cannot fathom how much I've mourned. What thousands of years of grief has done to me.
What's going on? Guys?
Hold on, guys!
Connie!
I know this sword. This is the sword that shattered her!
You deserve this. All of you.
Stop. Please!
Steven!
What do we do?
I don't know. She won't listen. She just wants to fight.
Blue Diamond!
Who are you supposed to be?!
I am the will of two Gems to care for each other. Protect each other from any threat. No matter how vast or how cruel. You couldn't stop me 5,750 years ago and you can't stop me now.
It's you! That Ruby and Sapphire that disrupted my court.
Ugghhh! This is supposed to be my day!
You hoped to defeat me by clinging to my feet?!
I just needed to keep you from taking three steps to the right.
What?!
Lapis?! You're really here.
Hey.
Lapis! You came back! Again!
Crystal Gem, I might as well be one. Right? You got room for one more?
Of course!
Save the hugs for after the fight! Look alive!
Lapis Lazuli? Does every Gem that comes in contact with this planet turn traitor?!
What?
I've felt worse.
Knock her off this beach!
Now's our chance!
With all our strength together, we can take her down.
That's right! This is our home, our planet, our friends and family! We... are the Crystal Gems!
Pathetic! You are nothing!
Hey Blue Diamond, fight me!
You got guts, tiny. Let me give you a hand.
Everyone, group up!
The house!
Don't worry, I can fix it.
My dad!
Uh oh.
Alright, I'm sticking with you guys.
Did we do it?
Cluster, you were amazing! Are you okay? Do you wanna go back in your bubble?
Okay, take it easy. You're the best!
So that is a wedding reception. Nice job, wedding planner.
Did you see that?! She couldn't lay a finger on me!
Hmm... But did you notice how I perfectly managed my trajectory right into her eyes. I'll demonstrate. Launch me again!
I like you, Peridot. You don't quit.
Heh, I told her off once. I can do it again. Hey! Yellow Clod! Remember me?!
No.
Stop! Don't do this! Listen to me! I'm the one you're missing! I'm Pink Diamond!
You!
Steven!
Huh!
Steven!
Connie, what's wrong?
Come on, please wake up!
I'm up, I'm up. What's going on? Connie I'm right here.
Come on, Steven. We need you.
What the hoo-hah?! Huh, well this is new. What is this place?
What else have you got?! I've only just begun to fight!
Lapis!
Connie, are you seeing this?
Wake up, please! (We're supposed to be in this together, remember?
Uh, Connie, I'm o-kay?
Huh? Steven?
Huh?
Connie, it's me!
Where are you? How are you...?
I'm not sure, but I think it's a classic psychic ghost type situation.
Ah, of course! So, what's the plan?
The Diamonds won't listen to me out there, but maybe I can get through to them here. They gotta know Pink Diamond wasn't shattered. Please protect my body while I'm gone.
Got it. Good luck out there, Steven.
This is it. I've got to hold it together. I've got to hold everyone together!
You can do it, Garnet! Remember: You're made of love!
Steven? (Huh, always full of surprises.)
Don't get shattered, don't get shattered, don't get shattered!
Amethyst, I believe in you!
Steven? I can do this, I can do this, I can do this!
I won't give up. Everything I do, I do it for her! I do it for him!
Don't forget about yourself, Pearl!
I do it for me!
I just got my friends back, and now, I'm gonna lose 'em again?!)
We can do this, together!
What am I thinking? We haven't lost yet!
Hang in there, Peridot. You too, Lapis
How miserable. I knew Pink couldn't handle her own colony. But, I gave in. And now, I'm to blame for her fate.
Ah, her thoughts are too strong!
What good will any of this do? The more I make these Gems suffer, the more I long to see you again, Pink.
Blue Diamond, please listen!
I felt something. Someone.
It worked. I gotta get through to them. Pink isn't gone! I can explain everything if you just stopped this fighting! Wooaahh!
There it is again.
What are you jabbering about?
A presence! It feels like...
Please, Blue. You're being hysterical. More so than usual.
Listen, Yellow. Pink's fate is different than you think. She faked her shattering!
This feeling. I know it!
It must be a trick! Show yourself, foe!
I'm not your foe. Please just listen to me.
There!
Please, the fighting has to stop. We aren't enemies. We're family. Please listen to me. I need you to know who I am!
Impossible!
This aura...
It's you... Pink!

41
transgrab.py Normal file
View File

@ -0,0 +1,41 @@
import requests, re
from jsonpath import jsonpath
from urllib.parse import quote as raw_quote
import argparse
# deals with quote treating slashes as safe by default
def quote(s):
return raw_quote(s,safe='')
# gets transcript for episode eptitle, if raw then return raw JSON response, passthrough direction style
def getTranscript(eptitle="Gem Glow",raw=False,dir_style=1):
r = requests.get("http://steven-universe.wikia.com/api.php?format=json&action=query&titles={}%2FTranscript&prop=revisions&rvprop=content".format(quote(eptitle)))
r.raise_for_status()
if raw: return r.text
r = r.json()
return processTranscript(r,dir_style)
def processTranscript(r,dir_style=1):
text = jsonpath(r,"$.query.pages.[0]")[0]["*"].split("\n")[2:-1]
text = ["".join(filter(lambda x: ord(x) in range(128),s)) for s in text] # filter music notes and other unicode chars
text = [x for x in filter(lambda x: len(x.split("|")[1])>0,text)]
text = [x.split("|",2)[2][:-2] for x in text]
if dir_style==1:
text = [x.replace("(","").replace(")","") for x in text]
text = [re.sub("''.*''","",x) for x in text]
elif dir_style==2:
text = [re.sub("\([^)]*\)","",x).replace(" "," ") for x in text]
text = [re.sub(r"\[\[[^|]*\|(.*)\]\]",r"\g<1>",x).replace("[[","").replace("]]","") for x in text]
return "\n".join(text)
def normalize(t):
return t.lower().replace(" ","_")
if __name__=="__main__":
parser = argparse.ArgumentParser(description="Grabs transcripts.")
parser.add_argument("--raw","-r",action="store_true",help="Store raw JSON response")
parser.add_argument("--directive-style","-d",help="Style of directives. 1 = double apostraphe and parens, 2 = just parens",nargs="?",default=1,type=int)
parser.add_argument("title",help="title of episode")
args = parser.parse_args()
with open("corpora/{}.txt".format(normalize(args.title)),"w") as f:
f.write(getTranscript(args.title,args.raw,args.directive_style))