diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..40ad177 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/ConvertedExample.json b/ConvertedExample.json new file mode 100644 index 0000000..5893acd --- /dev/null +++ b/ConvertedExample.json @@ -0,0 +1,12 @@ +{ + "Episode":{ + "Cast":["CastMember1", "CastMember2", "CastMember3"], + "Scenes":{ + "1":{ + "SceneDescription":"The description of what is happening in the scene", + "lines":[{"Character":"CastMember1","Line":"Line that iks said by CastMember1"},{"Character":"CastMember1","Line":"Line that is said by CastMember2"}] + } + } + } + } +} diff --git a/FriendsConverter.py b/FriendsConverter.py index 7adb5eb..5dd994f 100644 --- a/FriendsConverter.py +++ b/FriendsConverter.py @@ -1,16 +1,57 @@ import sys import json +cast=[] +Scenes = '"Scenes":{' + +def CheckScene(sceneString): + Data = '"lines":[{' + linesEtc=sceneString = sceneString + while(True): + if (linesEtc.find("
") == -1 or linesEtc.find(":") == -1 or linesEtc.find("
") == -1): + print("NO TAGS FOUND TO CREATE A LINE, MOVING ON TO THE NEXT ONE") + break + temp = linesEtc[linesEtc.find(""):] + temp = temp[:temp.find("
")] + noBtag = temp.replace("", "") + noBtag = noBtag.replace("", "") + noBtag = noBtag[noBtag.find("")+3:noBtag.find("
")] + character = noBtag[:noBtag.find(":")] + if not(character in cast): + cast.append(character) + line = noBtag[noBtag.find(":")+2:] + line = line.replace('"', '\\"') + if (len(character) == 0) or len(line) == 0: + print("NO CHARACTER FOUND OR NO LINE FOUND,\n LINE = " + line + "\n BY = " + character) + break + Data = Data+'"Character":"'+character+'","Line":"'+line+'"},{' + linesEtc=linesEtc[len(noBtag):] + Data=Data[:len(Data)-2]+"]" + return Data file = sys.argv[1] with open(file, "r") as infile: script=infile.read().replace('\n', '\\n') +SceneCounter = 1 while (True): if(script.find("[Scene:") == -1): break - TestFromSceneOn = script[script.find("[Scene:"):] - tempEndOfScript= script[:script.find("[Scene:")] - print(tempEndOfScript) - script = TestFromSceneOn[script.find("[Scene:")+7:] - print("END OF TEST") -print(TestFromSceneOn) + TestFromSceneOn = script[script.find("[Scene:")+7:] + tempEndOfScript= TestFromSceneOn[:TestFromSceneOn.find("[Scene:")] + Desc = tempEndOfScript[:tempEndOfScript.find("]")] + ToConvLines=tempEndOfScript[tempEndOfScript.find("]"):] + Lines = CheckScene(ToConvLines) + Scenes = Scenes+'"'+str(SceneCounter)+'":{"SceneDescription":"'+Desc+'"},'+Lines+"}," + script = TestFromSceneOn[TestFromSceneOn.find("[Scene:")+7:] + SceneCounter = SceneCounter+1 +Scenes = Scenes[:len(Scenes)-1]+"}" +castStr='"' +for member in cast: + if(len(member) > 25): + continue + castStr=castStr+member+'","' +castStr = castStr[:len(castStr)-2]+']' +with open(file+".json", "w+") as outfile: + outfile.write('{"Episode":{"Cast":['+castStr+','+Scenes+'}') + +#print(TestFromSceneOn) diff --git a/The One After Ross Says Rachel.html.json b/The One After Ross Says Rachel.html.json new file mode 100644 index 0000000..e0303df --- /dev/null +++ b/The One After Ross Says Rachel.html.json @@ -0,0 +1,43 @@ +{"Episode":{ + "Cast":["Minister","Ross","Rachel","Emily","Mrs. Geller","Joey","Chandler","Monica","Phoebe","Mr. Waltham","Mrs. Waltham","(They all hug",""], + "Scenes":{ + "1":{ + "SceneDescription":" Ross�s Wedding, continued from last season, the Minister is about to marry\nRoss and Emily."}, + "lines":[{"Character":"Minister","Line":"Friends. Family. We are gathered to celebrate here today the joyous\nunion of Ross and Emily. (Time lapse) Now Ross, repeat after me. I Ross.."}, + {"Character":"Ross","Line":"I Ross.."}, + {"Character":"Ross","Line":"I Ross.."}, + {"Character":"Ross","Line":"I Ross.."}, + {"Character":"Minister","Line":"Take thee, Emily.."}, + {"Character":"Ross","Line":"Take thee, Rachel...(All his friends have looks of shock on their faces.\nHe realizes what he said. Quickly he says.) Emily. (A slight chuckle.) Emily"}, + {"Character":"Minister","Line":"(Looking and feeling awkward. he looks towards Emily.) Uhh...Shall I\ngo on"}, + {"Character":"Rachel","Line":"(To the woman sitting in front of her) He-he said Rachel, right? Do you\nthink I should go up there"}, + {"Character":"Emily","Line":"Yes, yes, do go on"}, + {"Character":"Emily","Line":"Yes, yes, do go on"}, + {"Character":"Emily","Line":"Yes, yes, do go on"}, + {"Character":"Emily","Line":"Yes, yes, do go on"}, + {"Character":"Minister","Line":"I think we�d better start again. Ross, repeat after me. I,\nRoss��"}, + {"Character":"Ross","Line":"I, Ross��"}, + {"Character":"Ross","Line":"I, Ross��"}, + {"Character":"Ross","Line":"I, Ross��"}, + {"Character":"Ross","Line":"I, Ross��"}, + {"Character":"Minister","Line":"Take thee, EM-I-LY��"}, + {"Character":"Minister","Line":"Take thee, EM-I-LY��"}, + {"Character":"Ross","Line":"Take thee, (Glares at the Minister) Emily. (Chuckles) Like\nthere�d be anybody else. (Emily is glaring at him."}, + {"Character":"Minister","Line":"As my lawfully wedded wife, in sickness and in health, till death\nparts us"}, + {"Character":"Ross","Line":"As my lawfully wedded wife, in sickness and in health, until death parts\nus. Really, I do. Emily. (Points at her."}, + {"Character":"Minister","Line":"May I have the rings? (He is given the rings) Emily, place this ring\non Ross�s finger as a symbol of your bond everlasting. (She jams the ring onto his\nfinger) Ross, place this ring in Emily�s hand as a symbol of the love that encircles\nyou forever"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Ross","Line":"Happy too"}, + {"Character":"Minister","Line":"Ross and Emily have made their declarations and it gives me great\npleasure to declare them husband and wife"}, + {"Character":"Ross","Line":"Yay"}, + {"Character":"Ross","Line":"Yay"}, + {"Character":"Ross","Line":"Yay"}, + {"Character":"Ross","Line":"Yay"}, + {"Character":"Ross","Line":"Yay"}, + {"Character":"Minister","Line":"You may kiss the bride"},{"Character":"(He goes to kiss her, but she isn�t very receptive of the kiss. She keeps avoiding\nhim, until Ross finally gets to kiss her on her cheek","Line":"He goes to kiss her, but she isn�t very receptive of the kiss. She keeps avoiding\nhim, until Ross finally gets to kiss her on her cheek."},{"Character":"Mrs. Geller","Line":"(To Mr. Geller) This is worse than when he married the lesbian"},{"Character":"(The band starts to play, and the recessional starts. Ross tries to take Emily�s\nhand, but she snatches it away from him","Line":"The band starts to play, and the recessional starts. Ross tries to take Emily�s\nhand, but she snatches it away from him."},{"Character":"Emily","Line":"Just keep smiling"},{"Character":"Emily","Line":"Just keep smiling"},{"Character":"Emily","Line":"Just keep smiling"},{"Character":"Emily","Line":"Just keep smiling"},{"Character":"Ross","Line":"Okay"},{"Character":"Ross","Line":"Okay"},{"Character":"Ross","Line":"Okay"},{"Character":"Ross","Line":"Okay"},{"Character":"Joey","Line":"Well, that went well. Yeah"},{"Character":"Chandler","Line":"It could�ve been worse, he could�ve shot her"},{"Character":"(Ross and Emily make it to the lobby","Line":"Ross and Emily make it to the lobby."},{"Character":"(Ross and Emily make it to the lobby","Line":"Ross and Emily make it to the lobby."},{"Character":"Ross","Line":"(laughs) That uh, that was pretty funny. Wasn�t it"}]},"2":{"SceneDescription":" London Marriott, Monica and Chandler are walking to her room."},"lines":[{"Character":"Chandler","Line":"Listen, in the middle of everything if I scream the word,\n\"Yippee!\" just ignore me"},{"Character":"(She laughs and opens the door to reveal Rachel sitting on the bed","Line":"She laughs and opens the door to reveal Rachel sitting on the bed."},{"Character":"Monica","Line":"Oh my God, Rachel! Hi"},{"Character":"Monica","Line":"Oh my God, Rachel! Hi"},{"Character":"Chandler","Line":"Oh, hello Rachel"},{"Character":"Chandler","Line":"Oh, hello Rachel"},{"Character":"Rachel","Line":"Ross said my name. Okay? My name. Ross said my name up there that\nobviously means that he still loves me! (They both just stare at her.) Okay, don�t\nbelieve me, I know I�m right�do you guys want to go downstairs and get a drink"},{"Character":"Chandler","Line":"Yes, we do. But, we have to change first"},{"Character":"Monica","Line":"Yes, I want to change. And why-why don�t you go down and get us a\ntable"},{"Character":"Chandler","Line":"Yeah, we�ll be down in like five minutes"},{"Character":"Chandler","Line":"Yeah, we�ll be down in like five minutes"},{"Character":"Monica","Line":"(elbows him) Fifteen minutes"},{"Character":"Monica","Line":"(elbows him) Fifteen minutes"},{"Character":"Rachel","Line":"Okay"},{"Character":"Rachel","Line":"Okay"},{"Character":"Rachel","Line":"Okay"},{"Character":"Rachel","Line":"Okay"},{"Character":"(The phone rings and Rachel answers it","Line":"The phone rings and Rachel answers it."},{"Character":"Rachel","Line":"Hello? Oh, Pheebs! (To them) It�s Phoebe"},{"Character":"Chandler","Line":"Oh, yay��"},{"Character":"Chandler","Line":"Oh, yay��"},{"Character":"Chandler","Line":"Oh, yay��"},{"Character":"Monica","Line":"Great��"},{"Character":"Monica","Line":"Great��"},{"Character":"Monica","Line":"Great��"},{"Character":"Rachel","Line":"Hi"},{"Character":"Rachel","Line":"Hi"},{"Character":"Rachel","Line":"Hi"},{"Character":"Phoebe","Line":"Hi, so what happened"},{"Character":"Rachel","Line":"Well, Ross said my name"},{"Character":"Rachel","Line":"Well, Ross said my name"},{"Character":"Phoebe","Line":"Yeah, I know, but I don�t think that means anything"},{"Character":"Rachel","Line":"Okay, Pheebs, y�know what, let�s look at this objectively all\nright? Ninth grade, right? The obsession starts. All right? The summer after ninth grade\nhe sees me in a two-piece for the first time, his obsession begins to grow. So then��"},{"Character":"Chandler","Line":"(To Monica) Hey, listen, why don�t we go change in my room"},{"Character":"Monica","Line":"But my clothes are�ohh! (They both leave."},{"Character":"Monica","Line":"But my clothes are�ohh! (They both leave."},{"Character":"(Cut to Chandler�s room, he opens the door slowly to see if Joey is there and\nafter seeing that he isn�t, ushers Monica into the room, closes the door, and the\nsecurity bar","Line":"Cut to Chandler�s room, he opens the door slowly to see if Joey is there and\nafter seeing that he isn�t, ushers Monica into the room, closes the door, and the\nsecurity bar."},{"Character":"Chandler","Line":"Wow, you look��"},{"Character":"Chandler","Line":"Wow, you look��"},{"Character":"Chandler","Line":"Wow, you look��"},{"Character":"Monica","Line":"No time for that"},{"Character":"Monica","Line":"No time for that"},{"Character":"(They both start to frantically rip each other�s clothes off, but are interrupted\nwhen Joey tries to open the door","Line":"They both start to frantically rip each other�s clothes off, but are interrupted\nwhen Joey tries to open the door."},{"Character":"Joey","Line":"Hey, dude, let me in. I got a girl out here"},{"Character":"Chandler","Line":"Well, I�ve got a girl in here"},{"Character":"Chandler","Line":"Well, I�ve got a girl in here"},{"Character":"Joey","Line":"No you don�t, I just saw you go in there with Monica"},{"Character":"Chandler","Line":"Well, we�re-we�re hanging out in here"},{"Character":"Chandler","Line":"Well, we�re-we�re hanging out in here"},{"Character":"Joey","Line":"Look, which one of us is gonna be having sex in there, me or you"},{"Character":"Chandler","Line":"Well, I suppose I�d have to say you!! But, what if we�re\nwatching a movie in here"},{"Character":"Monica","Line":"Which we are, and-and we already paid for it. It�s My Giant"},{"Character":"Joey","Line":"My Giant? I love that movie"},{"Character":"Joey","Line":"My Giant? I love that movie"},{"Character":"Joey","Line":"My Giant? I love that movie"}]},"3":{"SceneDescription":" Ross and Emily�s room, the next morning. Ross is now asleep and has his\nhead in Monica�s lap and his feet on Chandler�s lap. Monica and Chandler are\nboth still awake and depressed."},"lines":[{"Character":"Chandler","Line":"We have to leave for New York in an hour"},{"Character":"Monica","Line":"I know, I�ve been looking at those doors, they look pretty sound\nproof, don�t you think"},{"Character":"Chandler","Line":"We can�t do that that�s insane. I mean �A� he\ncould wake up and �B� y�know, let�s go for it"},{"Character":"(They both try to slowly extricate themselves from Ross, but there�s a knock on\nthe door that awakens him","Line":"They both try to slowly extricate themselves from Ross, but there�s a knock on\nthe door that awakens him."},{"Character":"Ross","Line":"Em-Emily? (Looking around for her.) Em-Emily? (He runs to the door.)\nEmily! (He opens the door to reveal the Walthams standing outside."},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mr. Waltham","Line":"No"},{"Character":"Mrs. Waltham","Line":"You can forget about Emily, she�s not with us"},{"Character":"Mr. Waltham","Line":"We�ve come for her things"},{"Character":"Mr. Waltham","Line":"We�ve come for her things"},{"Character":"Ross","Line":"Wait, well wh-wh-wh-where is she"},{"Character":"Mr. Waltham","Line":"She�s in hiding. She�s utterly humiliated. She\ndoesn�t want to see you ever again"},{"Character":"Mrs. Waltham","Line":"We�re very sad that it didn�t work out between you and\nEmily, monkey. But, I think you�re absolutely delicious"},{"Character":"Mr. Waltham","Line":"Excuse me, I�m standing right here"},{"Character":"Mr. Waltham","Line":"Excuse me, I�m standing right here"},{"Character":"Mrs. Waltham","Line":"Oh yes, there you are"},{"Character":"Mrs. Waltham","Line":"Oh yes, there you are"},{"Character":"Rachel","Line":"(entering, carrying an armful of those little soaps.) Hey-hey, you guys\noh hurry up, get some, there�s a whole cart outside� (Sees the Walthams and\nstops."},{"Character":"Mr. Waltham","Line":"Goodbye Geller"},{"Character":"Mr. Waltham","Line":"Goodbye Geller"},{"Character":"Mr. Waltham","Line":"Goodbye Geller"},{"Character":"Ross","Line":"Now, hold on! Hold on! (Stops him) Look, look, your daughter and I are\nsupposed to leave tonight for our honeymoon, now-now you-you tell her that I�m gonna\nbe at that airport and I hope that she�ll be there too! Oh yeah, I said Rachel�s\nname, but it didn�t mean anything, Okay? She�s-she�s just a friend and\nthat�s all! (Rachel sits down, depressed.) That�s all! Now just tell Emily that\nI love her and that I can�t imagine spending my life with anyone else. Please,\npromise me that you�ll tell her that"},{"Character":"Mr. Waltham","Line":"All right, I�ll tell her. (To his wife) Come on bugger face"},{"Character":"Mrs. Waltham","Line":"(As she walks pass Ross, she pats his but.) Call me"},{"Character":"Mr. Waltham","Line":"You spend half your life in the bathroom, why don�t you ever\ngo out the bloody window"}]},"4":{"SceneDescription":" Monica and Rachel's, Phoebe is eating cereal from a bowl she has balanced on\nher stomach as Joey, Chandler, and Monica return."},"lines":[{"Character":"Phoebe","Line":"Hey"},{"Character":"Chandler","Line":"Hey"},{"Character":"Chandler","Line":"Hey"},{"Character":"Chandler","Line":"Hey"},{"Character":"Joey","Line":"Hi"},{"Character":"Joey","Line":"Hi"},{"Character":"Joey","Line":"Hi"},{"Character":"(They all hug","Line":"They all hug."},{"Character":"(They all hug","Line":"They all hug."},{"Character":"Phoebe","Line":"(To Joey) You ate meat! (Joey is shocked) (To Chandler and Monica) You\nhad sex! (They�re shocked."},{"Character":"Chandler","Line":"No we didn�t"},{"Character":"Chandler","Line":"No we didn�t"},{"Character":"Phoebe","Line":"I know you didn�t, I was talking about Monica"},{"Character":"Monica","Line":"Phoebe, I did not have sex"},{"Character":"Monica","Line":"Phoebe, I did not have sex"},{"Character":"Phoebe","Line":"This pregnancy is throwing me all off"},{"Character":"Joey","Line":"All right, I�m gonna go say hi the chick and the duck"},{"Character":"Phoebe","Line":"Oh, me too"},{"Character":"Phoebe","Line":"Oh, me too"},{"Character":"Phoebe","Line":"Oh, me too"},{"Character":"Phoebe","Line":"Oh, me too"},{"Character":"Phoebe","Line":"Oh, me too"},{"Character":"Joey","Line":"Why would you need to say hi to them, you�ve been feeding them for\nfour days"},{"Character":"Phoebe","Line":"Oh right, maybe I�ll just go home."},{"Character":"Phoebe","Line":"Oh right, maybe I�ll just go home."},{"Character":"(She grabs her bag and leaves, Joey moves a little quicker to his apartment, leaving\nMonica and Chandler alone","Line":"She grabs her bag and leaves, Joey moves a little quicker to his apartment, leaving\nMonica and Chandler alone."},{"Character":"Monica","Line":"Well, we certainly are alone"},{"Character":"Chandler","Line":"Yes! Good thing we have that, �Not in New York� rule"},{"Character":"Monica","Line":"Right. Umm, listen since we�re-we-re on that subject, umm, I just\nwanted to tell you that uh, well, I-I was going through a really hard time in London, what\nwith my brother getting married and that guy thinking I was Ross�s mother��"},{"Character":"Chandler","Line":"Right"},{"Character":"Chandler","Line":"Right"},{"Character":"Chandler","Line":"Right"},{"Character":"Chandler","Line":"Right"},{"Character":"Chandler","Line":"Right"},{"Character":"Chandler","Line":"Right"},{"Character":"Monica","Line":"Well, an-anyway, I just�that night meant a lot to me, I guess\nI�m just trying to say thanks"},{"Character":"Chandler","Line":"Oh. Y�know, that night meant a lot to me too, and it wasn�t\nbecause I was in a bad place or anything, it just meant a lot to me �cause,\nyou�re really hot! Is that okay"},{"Character":"Monica","Line":"(laughs) That�s okay"},{"Character":"Monica","Line":"(laughs) That�s okay"},{"Character":"Monica","Line":"(laughs) That�s okay"},{"Character":"Chandler","Line":"And I�m cute too"},{"Character":"Chandler","Line":"And I�m cute too"},{"Character":"Monica","Line":"And you�re cute too"},{"Character":"Chandler","Line":"Thank you! (They hug.) All right, I gotta go unpack"},{"Character":"Monica","Line":"Okay"},{"Character":"Monica","Line":"Okay"},{"Character":"Monica","Line":"Okay"},{"Character":"Monica","Line":"Okay"},{"Character":"Monica","Line":"Okay"},{"Character":"Chandler","Line":"Bye."},{"Character":"Chandler","Line":"Bye."},{"Character":"Chandler","Line":"Bye."},{"Character":"(After he closes the door, Monica starts to follow him, but thinks better of it and\nstops","Line":"After he closes the door, Monica starts to follow him, but thinks better of it and\nstops."},{"Character":"Chandler","Line":"(entering) I�m still on London time, does that count"},{"Character":"Monica","Line":"That counts"},{"Character":"Monica","Line":"That counts"},{"Character":"Monica","Line":"That counts"},{"Character":"Chandler","Line":"Oh, good! (They start kissing."}]},"5":{"SceneDescription":" Flight 1066 to Athens, Rachel is ordering a drink for Ross and herself."},"lines":[{"Character":"Rachel","Line":"Ahh, yes, I will have a glass of the Merlot and uh, (points to\nRoss�s seat.) he will have a white wine spritzer. Woo! (Looks out the window.) Hey,\nlook at that, the airport�s moving. (Realizes that that�s not how it works.)\nHey, are we moving?! Are we moving? Why are we moving? Hey, time-out, umm, yeah, does the\ncaptain know that we�re moving? (Sits back in defeat.) Oh my God. Oh, my gosh"}]}}}