airvideo 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +2 -9
  2. data/VERSION +1 -1
  3. data/lib/airvideo.rb +2 -3
  4. metadata +3 -3
@@ -8,15 +8,8 @@ but it will give you the Streamable and Playable URLs of the videos on your AirV
8
8
  == Usage
9
9
  I'd like to be able to write a shiny GUI for all this, but alas, I am crap at the GUI. So as it stands you'll need to do this:
10
10
 
11
- my_vids = AirVideo::Client.new('me.dyndns.org',45631,'01234_PASSWORD_DIGEST_SEE_BELOW_5678')
11
+ my_vids = AirVideo::Client.new('me.dyndns.org',45631,'YOUR PASSWORD')
12
12
  # => <AirVideo Connection: me.dyndns.org:45631>
13
13
  my_vids.ls
14
14
 
15
- == Passwords
16
- If you've ever played with storing passwords you'll know about cryptographic hashing and using salts.
17
-
18
- Essentially when you store a password, you don't store the actual password, you store the result of a cryptographic algorithm acting on the password and a string unique to your project (your salt). This means that people can't find out what the passwords are and won't be given access unless they know both the password *and* the salt.
19
-
20
- As it currently stands I don't know the salt for the AirVideo system. I think it's an SHA1 algorithm, but there's no real way to know unless I know the salt or reverse engineer their server or iPhone app. That's a little over my head, so instead if you want to use a password on your AirVideo server you'll need to hunt down your password digest.
21
-
22
- This gist: http://gist.github.com/412133 will tell you what your passwordDigest is for you. You'll need the pcap libraries and gem installed, as well as read access to the device you're serving AirVideo from.
15
+ If you have the ENV['HTTP_PROXY'] variable set (to something like 'myproxy.com:8080') then everything will be piped through there too.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'stringio'
3
+ require 'digest/sha1'
3
4
 
4
5
  # == TODO
5
6
  # * Potential bug: can you cd into a file?
@@ -17,8 +18,6 @@ module AirVideo
17
18
  # Specify where your AirVideo Server lives. If your HTTP_PROXY environment variable is set, it will be honoured.
18
19
  #
19
20
  # At the moment I'm expecting ENV['HTTP_PROXY'] to have the form 'sub.domain.com:8080', I throw an http:// and bung it into URI.parse for convenience.
20
- #
21
- # I haven't currently worked out what the AirVideo salt is (or even confirmed that it is SHA1) so you'll need to snoop your own passwordDigest and pass it into the last term, or not use one for now.
22
21
  def initialize(server,port = 45631,password=nil)
23
22
  if ENV['HTTP_PROXY'].nil?
24
23
  @http = Net::HTTP
@@ -27,7 +26,7 @@ module AirVideo
27
26
  @http = Net::HTTP::Proxy(proxy.host, proxy.port)
28
27
  end
29
28
  @endpoint = URI.parse "http://#{server}:#{port}/service"
30
- @passworddigest = password
29
+ @passworddigest = Digest::SHA1.hexdigest("S@17" + password + "@1r").upcase if !password.nil?
31
30
 
32
31
  @req = Net::HTTP::Post.new(@endpoint.path)
33
32
  @req['User-Agent'] = 'AirVideo/2.2.4 CFNetwork/459 Darwin/10.0.0d3'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airvideo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - JP Hastings-Spital