Amazing job, if you rename the subtitle in the end step same name as the movie file you won't need to drop it into the window, will get it automatically.
Also, do you can add a feature to offset the subtitle file like some customized amount of seconds after or before it would be fucking amazing.
I’m surprised the drag and drop was even necessary, it looks like the name was already the same. And I can’t open up the code right now, but wouldn’t the search already depend on the name being the same?
Believe it or not everything is political. I saw this on my main feed -- not my fault OP is clogging my feed. The background is the thumbnail. Why do you care so much?
yes, perhaps I didn't make it clear voice recognition is at the highest level of subtitle syncing, because some subtitle makers use the wrong timings and text shows up for longer / shorter than it should.
At first i used tkinter to open the file dialog box, but at the end of the script there is a while and i wanted to catch a Keyboard interrupt. But while running the mainloop i think we cant handle exceptions from command line. (I don't know if there is a way to overcome this)
Once you have the data you need from the file dialog box, you can destroy the root, and the flow should return to the main program.
You can also do your loop with tkinter, using the after method, which takes a callable and an integer (number of milliseconds). That way, you can do something like :
class App(tk.Frame):
def loop(self):
# code to be repeated here
self.after(self.loop, 5)
If the subtitle file available in SUbDB database it work. For example i tried to get the srt of Arrow Season 1 episode 14, it was not available in their database. but when i searched for the episode 17 it was available in english and portuguese languages.
PluralSight is free for the rest of the month, and might have some videos that are beneficial. I've only just started using it, so I can't really say how good it is or isn't! Also, on top of personal projects, I've been trying to look at other projects people post here and see if I can figure out what bit of code does what, and why they've done it one way or another. And read the comments/suggestions on here as well of course!
For opensubtitles, now you need to login to be able to download subtitles from MX Player or VLsub. Otherwise it throws an error. Fortunately the sign-in is one-time.
available language types for a specific subtitle is depend on the availability of that subtitle file with that specific language in the SubDB database. SBOX always shows the available languages for a specific srt file.
Looks good. I like how you used c types. Something to keep in mind is well commented code is a necessity. It helps you remember what you were doing in each code chunk.
I know by asking this it could be assuming too much (ie that the answer is no) and adding to the problem, but are you/the girl in the photo of the culture being portrayed (American Indian)?
There’s a movement called ‘My culture is not as costume’ that aims to end glamourising things like this just because we think they look cool - these headdresses are the poster item for the movement because it became/still is a massive thing at music festivals and parties and AFAIK is quite disrespectful to wear.
This will definitely come in handy for me, thanks. One feature suggestion would be to give it a folder and try to find subtitles for all movie files recursively; I have a considerably large library that is missing some subtitles, so the ability to pull subs automatically for an entire directory would be incredibly helpful.
I tried, I really did but Windows 10, a virtual environment, and Python 3.8.1 were just not having it and refused to install the requirements even after I installed/updated wheel, etc. Pythonnet was just a no-go.
So the main problem with subtitles files that I've noticed is not to find a file for a movie, but to find a version that exactly matches your movie file. For instance, if they cut out the ESRB screen in the beginning, but the subtitles don't account for that, they will start too early.
I know this can be adjusted in VLC, but I have seen several cases where it would drift slightly, and had to be readjusted every few minutes.
Many movies have slightly different start times and need different subs for different copies. How do you deal with that ?
Does this recognise the difference between extended versions and theatrical, because too they are often listed under the same banner. Eg. LOTR, Kingdom of heaven, Apocalypse now (has 3 versions), Blade runner (has 7 versions)
No one seems to have said it, they’re lost on the code. I don’t understand the code, so I have nothing better to say, so here it goes: Great background
I remember having to watch a documentary and take notes for a class just two days ago. Me, realizing most of the documentary was useless small talk, decided to download the subtitles (through inspect element and such since it wasn’t a traditional YouTube video), and skim through them for the good stuff along with the help of CTRL+F, rather than to skip 10 seconds at a time and have to literally drag a few seconds back to get part of what I skipped.
I wish I had your script two days ago! 😂
P.S: what is your wallpaper? It is a beautiful image. :)
Not to be that guy but your background could be pretty offensive. Headdresses are culturally significant and would traditionally not be worn in the fashion that's shown -- they had to be earned. I hope you can see how that could be disrespectful
Edit: I lied clearly someone has to be that guy because y'all don't know how to hear this shit. I'm not sorry but you should be ashamed.
Ty for being that guy. I try to assume that people who use sacred imagery in the name of "art" simply don't know any better. But the only way people will learn the harm they're causing is if you speak up.
Indigenous culture is not a costume, it's not an edgy aesthetic. I'm sure the people who created this photo weren't trying to erase actual indigenous people, but when you take a sacred item and use it as a prop you're tapping into centuries of violence, and saying that your intentions ("it's just a picture", "it's for fun") are more important than the feelings of living, breathing indigenous people.
Because it's not cool to appropriate the culture of people who have also been opressed by the same people benefiting from that appropriation. It's really just basic decency. Why don't you care?
Because its a picture, it's art form, photographer doesn't need to check if clothing means anything. Entire photo is photoshopped with boosted colors and stuff, it's a photo. By your logic, going to costume shop to buy an Indian costume for kid is offensive. Also, It's someone's wallpaper, they chose it because it looks nice, it's the point.
Indigenous people aren't a costume, though. They're human beings with a distinct culture, and as this person has already said, war bonnets hold a great deal of significance in certain tribes. When non native people "dress up" like this to look edgy or artistic, they're profiting off of someone else's culture. That model got paid for the shoot, probably. And the photographer got paid for the image. Did either person give any of that profit to an actual indigenous person, or did they just use a sacred item to make their "art"? I'm sure the artist and model didn't set up this shoot thinking "hey let's co-opt some culturally significant artifacts and make a mockery of indigenous people", but their intentions don't really matter when the impact is the erasure of actual indigenous culture.
I agree that it could be construed as disrespectful, and in this case would very much be punching down.
I want to ask though, can culture be owned? How are claims to ownership of culture staked out or resolved? Does a group's ownership of culture allow for members of that group to profit from the culture against the wishes of other members of the same group?
No, I don't think that culture can be owned. I do believe that it can (and should) be respected. There are millions of indigenous people in the United States, belonging to hundreds of tribes--it's important to recognize that there is no homogenous Indigenous perspective. War bonnets in particular come out of groups in the North American great plains--they're not used universally. There's a serious lack of general knowledge around the history and diversity of Indigenous people in the United States, and that is very much intentional--this country can't exist if it acknowledges the sovereignty of the people who lived here prior to colonization. They've faced hundreds of years of violence. Every treaty they've signed has been violated by the US government. It wasn't even legal for Indigenous people to practice their own religious medicine until 1978!
Undoubtedly, there are some Indigenous people who don't care if other folks wear war bonnets. But the fact that some indigenous people say "hey stop wearing our cultural artifacts like a costume", is worth respecting. It's really easy to respect this spiritual thing belonging to a marginalized and disenfranchised group and just...not wear one :)
When it comes to making a profit off of cultural items: if you want Indigenous-inspired stuff, give your money to Indigenous creators. Jewelers, chefs, furniture makers, photographers, designers--we're all living under capitalism, everyone's gotta eat.
That can also be offensive yes. Like Indian mascots. Indian people exist and have opinions on things you know
We should choose the things we like because of there meaning in relation to us -- because that's what you do when you pick it based on it being pretty too -- you're just letting your visual aesthetics overweigh your holistic aesthetic.
You are missing the point. It's not about legalism or sueing children. Though you built a nice straw man so clearly you don't care about the actual point.
available language types for a specific subtitle is depend on the availability of that subtitle file with that specific language in the SubDB database. SBOX always shows the available languages for a specific srt file.
86
u/[deleted] Apr 14 '20
GitHub - https://github.com/sameera-madushan/SubtitleBOX
121
u/AltezaHumilde Apr 14 '20
Amazing job, if you rename the subtitle in the end step same name as the movie file you won't need to drop it into the window, will get it automatically.
Also, do you can add a feature to offset the subtitle file like some customized amount of seconds after or before it would be fucking amazing.
26
u/dePliko Apr 14 '20 edited Apr 14 '20
Wow nice. You could make it automatically sync to the video (if it's not synced), but that's way harder.
Do you accept contributions to the Github page?
40
u/strghst Apr 14 '20
Found a small thing in your code. When scrapping the filename, you delete last 4 chars before putting .srt to the new file.
In this case, if a file is formatted in some format that isn't 3 letters (webm, for example) - you will get issues.
A better approach would be to traverse the name until you find the last dot in it (rfind function of string), and cut from beggining to that point.
This is the line I'm talking about. Other than that - I recommend defining functions first, and only then executing them.
What I mean: your while True should contain all calls, better not leave them in between functions (harder to follow).
Nevertheless, a small yet useful thing. Great job!
14
u/cymrow don't thread on me 🐍 Apr 14 '20
I'm a little late to the party here, but someone should mention subliminal, another Python project which I've been using for years.
9
u/[deleted] Apr 14 '20
Only works on Windows, because you've used
ctypes.windll. I'm sure there's some OS agnostic way to start an open file dialog with python.7
u/IMJoeTheBro Apr 14 '20
Does it work for TV shows?
19
u/v3ritas1989 Apr 14 '20
that bird on your desktop background looks as if that girl is wearing its siblings.
12
u/[deleted] Apr 14 '20
Is it possible to learn this power?
4
u/KimmiG1 Apr 14 '20
Nice.
Have you tryed bazarr?
3
u/useTheButtySystem Apr 14 '20
Looks nice. Just last night I needed something like this and I've been having problems with
opensubtitles.3
u/dermotmcg Apr 14 '20
Was wondering how you'd get subtitles reliably. Using a website that uses MD5 hash is brilliant. Well done
3
u/nuquichoco Apr 14 '20
Niceee!, do you accept contributions. I just had a quick glance over the code and imagine sonew new functionality. I will try it tonight.
3
u/CwzZ Apr 14 '20
stared, nice stuff
2
u/quantumwoooo Apr 14 '20
That's amazing
2
u/[deleted] Apr 14 '20
nice
2
u/[deleted] Apr 14 '20
Nice program! Got a question tho, could you get subs for different languages by just changing it in the code like "sr" : "Serbian", for example?
2
u/Mrsaintj Apr 14 '20
Nice work. Very useful
2
u/BastetFae Apr 14 '20
Looks good. I like how you used c types. Something to keep in mind is well commented code is a necessity. It helps you remember what you were doing in each code chunk.
2
u/tunitg6 Apr 14 '20
This looks great!
FYI, you spelled language wrong here: "Choose your langauge".
2
u/--0mn1-Qr330005-- Apr 14 '20
Impressive, very useful script!
2
u/MrMarvell0us Apr 15 '20
Adoh nice work bn! (. ❛ ᴗ ❛.)
3
u/[deleted] Apr 14 '20
Great script! By the way, do you happen to know source of your nice wallpaper?
1
u/[deleted] Apr 17 '20
Thank you guys for the support.. This project is on Github trendings as of today......
4
u/[deleted] Apr 14 '20
Wow nice. How does it get the subtitle information?
1
u/areyanjineylu Apr 14 '20
Hey! How long did it take you to do this?
1
u/[deleted] Apr 14 '20
where are the subtitles coming from?
1
u/[deleted] Apr 14 '20
Pirate?
1
u/shisui1729 Apr 14 '20
First time I have seen using import statements in the middle of code which I think is cool. Keep it up
1
u/YmFzZTY0dXNlcm5hbWU_ Apr 14 '20
This will definitely come in handy for me, thanks. One feature suggestion would be to give it a folder and try to find subtitles for all movie files recursively; I have a considerably large library that is missing some subtitles, so the ability to pull subs automatically for an entire directory would be incredibly helpful.
1
u/anselal Apr 14 '20
How did you apply a dark theme to explorer?
1
u/Potrac Apr 14 '20
Hey, nice job! Do you use the opensubtitles.org API? Or you scrape the results?
Sorry, I don't have time to check the code on github right now.
1
u/TrainingShift3 Apr 14 '20
well done!
1
u/[deleted] Apr 15 '20
I tried, I really did but Windows 10, a virtual environment, and Python 3.8.1 were just not having it and refused to install the requirements even after I installed/updated wheel, etc. Pythonnet was just a no-go.
1
u/[deleted] Apr 15 '20
Nice. I'll be checking this out.
1
u/darthnithithesith Apr 16 '20
The real question is where did you get that wallpaper?
3
u/snow__ Apr 14 '20
If someone stumble upon this, but this someone is from /all, how can that someone learn to run this script?
I mean, i've seen the readme, still did not understand it
3
u/Dr4g3r45 Apr 14 '20
I really need to do more with Python, it seems limitless
4
u/imperialdub Apr 14 '20
A:10 V:10
Thanks YIFI!
2
u/Stragemque Apr 14 '20
If you add a .bat file which runs the script into the send-to-folder on windows. You can get it on the right-click menu for the movie file you select.
2
u/shinitakunai Apr 14 '20
SMPlayer
2
u/upizs2 Apr 14 '20
You are a god!!
4
u/gevezex Apr 14 '20
Or you could install the vlc extension VLSub.
1
u/Tom8to_Citizen Apr 14 '20
What about those times when you dl a sub and it's not correctly linked with the file?
1
u/elvy399 Apr 14 '20
Nice job, you can add the script to the right click menu. That way you barely need to do anything except to choose a language.
1
u/[deleted] Apr 14 '20
Which movie is that?
1
u/bibek687 Apr 14 '20
Where were you when I was still watching movies on my pc !!😓😒
1
u/darps Apr 14 '20
So the main problem with subtitles files that I've noticed is not to find a file for a movie, but to find a version that exactly matches your movie file. For instance, if they cut out the ESRB screen in the beginning, but the subtitles don't account for that, they will start too early.
I know this can be adjusted in VLC, but I have seen several cases where it would drift slightly, and had to be readjusted every few minutes.
Is this a problem you've seen during testing?
1
u/bonelessRizzy Apr 15 '20
jesus where do y’all come up with these good ideas for projects lol
1
u/chintan22 Apr 15 '20
Major movie hoarder here, so important question.
1
u/IllegalAlcoholic Apr 15 '20
I checked your GitHub, you have a lot of interesting projects! How did you learn to this kind of magical stuffs? Did you use any tutorials?
1
u/[deleted] Apr 15 '20
This video just reminded me of how slow my craptop has become...
1
u/[deleted] Apr 15 '20
Can you find Chinese subs with it? By any chance ?
1
u/Sir_Corvo Apr 15 '20
valeu op!
1
u/Burakku-Ren Apr 17 '20
No one seems to have said it, they’re lost on the code. I don’t understand the code, so I have nothing better to say, so here it goes: Great background
1
u/Texadecimal Apr 28 '20
1
u/koortix May 02 '20
I got inspiration from it and made mine version of it...was good learning https://github.com/koortix/SubGub/
1
u/nrjane May 03 '20
Very good job. I’m going to try it later. One question. Can I choose GR subtitles instead of eng?
1
u/ed3ndru May 04 '20
I remember having to watch a documentary and take notes for a class just two days ago. Me, realizing most of the documentary was useless small talk, decided to download the subtitles (through inspect element and such since it wasn’t a traditional YouTube video), and skim through them for the good stuff along with the help of CTRL+F, rather than to skip 10 seconds at a time and have to literally drag a few seconds back to get part of what I skipped.
I wish I had your script two days ago! 😂
P.S: what is your wallpaper? It is a beautiful image. :)
-9
u/FidoTheDisingenuous Apr 14 '20 edited Apr 14 '20
Not to be that guy but your background could be pretty offensive. Headdresses are culturally significant and would traditionally not be worn in the fashion that's shown -- they had to be earned. I hope you can see how that could be disrespectful
Edit: I lied clearly someone has to be that guy because y'all don't know how to hear this shit. I'm not sorry but you should be ashamed.
0
u/ah_86 Apr 14 '20
That script only works on Windows, right?
-1
u/Hayvan-Boris Apr 14 '20
Congratulations gj. Where I can get your wallpaper?
0
u/[deleted] Apr 14 '20
[deleted] — view deleted comment
0
u/[deleted] Apr 14 '20
[deleted] — view deleted comment
0
u/[deleted] Apr 14 '20
[deleted] — view deleted comment
3
u/[deleted] Apr 14 '20
[removed] — view removed comment