Skip to content

Commit

Permalink
release 0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
marguerite committed Nov 17, 2014
1 parent 37de59e commit e0d827c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
1 change: 0 additions & 1 deletion BiliDaemon.rb

This file was deleted.

46 changes: 32 additions & 14 deletions BiliWeb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,57 @@ class BiliParser
@@index = "bilibili.tv.html"
@@indexfile = File.join($cachePath,@@index)

def initialize(url="http://bilibili.tv")
@url = url
@filename = $cachePath + "/" + @url.gsub(/http:\/\//,"") + ".html"
def initialize(array=["http://bilibili.tv"])

@filename = {}
array.each do |url|
filename = $cachePath + "/" + url.gsub(/http:\/\//,"") + ".html"
@filename[filename] = url
end

@pool = Queue.new

get

end

def get
content = open(@url).read
io = File.open(@filename, "w")
io.puts(content)

@filename.each do |array|
Thread.new {
content = open(array[1]).read
io = File.open(array[0], "w")
io.puts(content)
io.close
@pool << array[0]
}
end

clean
end

def clean

if @filename.index(@@index) then

biliMove(@filename,"line.index('/video/') && ! line.index('av271')")
@filename.size.times do

Thread.new {
file = @pool.pop

if file.index(@@index) then
biliMove(file,"line.index('/video/') && ! line.index('av271')")
else
p "[WARN] Don't know what to do!"
end
}

else
p "[WARN] Don't know what to do!"
end

end

def parse

hash1 = {}
hash2 = {}
lev1 = @@indexfile + ".l1"
lev2 = @@indexfile + ".l2"
lev1 = @@indexfile + ".l1"

biliMove(@@indexfile,lev1,"line.index('i-link')")

Expand Down
1 change: 0 additions & 1 deletion BiliWidgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def init_ui
# Web Tab
menu = Qt::MenuBar.new(webTab)
lev1 = BiliParser.new.parse
p lev1
lev1.each do |array|
name = array[1].gsub(/\/video\//,'').gsub(/\.html/,'')
name = Qt::Menu.new "#{array[0]}"
Expand Down
4 changes: 4 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.0.9
* make it themeable (external stylesheet .qss)
* clean module usage, don't need to create wrapper classes
* multithread Url fetch in BiliWeb
0.0.8
* fix: BiliSave will remove the Playlist!
* BiliUrl and Bangou (avXXXXXX) mix paste support
Expand Down

0 comments on commit e0d827c

Please sign in to comment.