Posts: 1,497
Joined: Oct 2005
Reputation:
104
I guess...I'm wondering, what is the end goal of decompiling the swf player? Are you trying to make a script that gives you the forecast?
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
yes, i want to be able to add videos to "twc supplemental" script
Posts: 1,497
Joined: Oct 2005
Reputation:
104
2009-01-06, 00:57
(This post was last modified: 2009-01-06, 01:02 by digitalhigh.)
Well, those streams are always going to be updated for the city, right? So, in theory, you only need to figure out the names of every video/city once?
Edit: It looks like the video names are just "Cityname.flv", unless there are two states with the same city...you'd just have to go down the list and note which ones are dupes...
Only one that should be different are the Portlands. Every other city is unique. Green Bay is just greenbay.flv.
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
I have been looking into to this. I can't seem to find where city lists are coming from. i have been looking at the action script for several of the swf files that the original downloads. i was hoping it would be an xml file or something but no such luck so far. I am sick so i am working kinda slow but i will keep looking till i find the answer. surely they're aren't hard coded in the swf files it would be so inflexible for adding new cities.
Posts: 1,497
Joined: Oct 2005
Reputation:
104
I must be missing something...why not just make up a list of the major cities in every state, then just have it insert that cityname in a string and have the script see if the URL returns a file. If not, then have it try it with citynameXX where XX is the state initial. It's gotta be one of those two combinations, and if not, then it doesn't exist.
This assumes, of course, that you can have the script try to download a file and report an error if there is no file there...
To determine the cityname, just have it hit a website or list of zip codes/cities...
Posts: 1,432
Joined: May 2004
Reputation:
73
BlueCop
Skilled Python Coder
Posts: 1,432
Indeed that is possible but it is mostly curiosity for me. I want to know how it works.
so why not? its more future proof to try to use the method that the swf file uses to get the names and urls rather then simply create database of the cities and videos.
I am also curious about the other videos available on the site and they aren't as simple as city names.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
Thanks to both of you.
BlueCop, don't strain you self, but if you figure it out. that would be great.
digitalhigh, i took what you said earlier and do exactly as you just posted. except i also have to try cityname"city" for newyorkcity.
in the original page there is a code omn_dma_code to find what city you have a local video for. that is in dma_names[code_number]. i then take omn_locstate, for the citynameXX test.
the problem is some cities don't have a local video, but a regional one, where the above doesn't work.
while this works fine for me, i would like it to work for other cities.
so if BlueCop can figure this out, it would be more universal.
thanks again
Posts: 843
Joined: Mar 2008
Just downloaded Sothink swf decomp
So let`s see wtf is going on.
Tried wiresharking the damn thing and ended up very annoyed after 1hour.
Will post back if i find anything.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
thanks appreciate it. i just downloaded that software also, but am lost.
if you find anything maybe the steps you took so i can do this myself in the future.
the .swf files it finds, are not the actual weather video, so i don't know how to proceed.
thanks again
rwparris that pyamf is huge, i hope it's not necessary. it also may need element tree. didn't play with it too much.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
I gave up and just hacked it in.
there seems to be only us videos and i think i have accounted for all the regions. not fully tested but works well for the most part.
thanks for your help.