Permalink
Browse files

Http get Error fix

  • Loading branch information...
1 parent 3187962 commit e81cbe8d5b58542fd9ba770e01d3206642ca5cbb @kevinwatt committed Jun 13, 2011
Showing with 18 additions and 54 deletions.
  1. +7 −4 httpget.go
  2. +1 −0 main.go
  3. +4 −1 urlpaser.go
  4. +6 −49 vv
View
11 httpget.go
@@ -17,10 +17,13 @@ func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastInd
func Get(url string) (string, os.Error) {
//var b []byte;
- resp,_,err := http.Get(url)
- b , _ := ioutil.ReadAll(resp.Body)
- resp.Body.Close();
- return string(b),err
+ var err os.Error;
+ if resp, err := http.Get(url); err == nil {
+ b , err := ioutil.ReadAll(resp.Body)
+ resp.Body.Close();
+ return string(b),err
+ }
+ return "error",err
}
func URLUnescape(edurl string) string {
View
1 main.go
@@ -36,6 +36,7 @@ func loadlist(m map[int]string) {
}else{
s.size=jobsplit
}
+ fmt.Printf("ts: %d\n",ts);
go s.urlparser(c,tf);
}
View
5 urlpaser.go
@@ -3,6 +3,7 @@ package main
import (
"regexp";
"strings";
+ "fmt";
)
type URLParse struct {
@@ -37,7 +38,9 @@ func (up *URLParse) urlparser(c chan string, tf chan map[string]string) {
}
}
}
- }
+ }else{
+ fmt.Printf("can't open url; err=%s\n", err.String())
+ }
}
tf<-parsedlink;
return;
View
55 vv
@@ -1,12 +1,10 @@
-# 《极速前进 第十八季》(The Amazing Race Season 18)[YYeTs人人影视原创翻译]
-http://www.simplecd.org/id/2147502191
+# 惡魔奶爸
+http://www.simplecd.org/id/2875529
#Chaos
-http://www.simplecd.org/id/2887391
-#《幻世浮生》(Mildred Pierce
-http://www.simplecd.org/id/2886542
+http://www.1000fr.com/archiver/tid-355691.html
# 《圣城风云 第一季
-http://www.simplecd.org/id/2885581
+http://www.simplecd.org/id/2147503225
#恶魔阿萨谢尔在召唤你
http://www.verycd.com/topics/2888325/
# Gintama
@@ -19,55 +17,14 @@ http://mirror.simplecd.org/id/2888277
http://www.simplecd.org/id/2873662
# Ted
http://www.simplecd.org/id/2859959
-# 《摩登家庭 第二季》(Modern Family S2)
-http://www.simplecd.org/id/2852806
-# 《极速前进 第十八季》(The Amazing Race Season 18)
-http://www.simplecd.org/id/2882180
-# 《脱狱之王 第一季》(Breakout Kings)
-http://www.simplecd.org/id/2147502807
#Raising Hope Season1
http://www.simplecd.org/id/2853034
-# Chuck
-http://www.simplecd.org/id/2147500409
-# the good wife
-http://www.simplecd.org/id/2147500890
-#-The.Mentalist
-http://www.simplecd.org/id/2147500883
-# House
-http://www.simplecd.org/id/2147500489
-#》(The Mentalist Season3)更新第12集缺11[中文字幕][RMVB]
-http://www.simplecd.org/id/2147500681
-#Running Wilde Season1
-http://www.simplecd.org/id/2147486408
#The middle
+http://www.simplecd.org/id/2854001
http://www.simplecd.org/id/2853333
-#Grey's Anatomy Season7
-http://www.simplecd.org/id/2147486995
# The Office
-http://www.simplecd.org/id/2147486411
-#Fringe
-http://www.simplecd.org/id/2147486442
-#hustle
-http://www.simplecd.org/id/2147500763
-#Lie to me
-http://www.simplecd.org/id/2147500416
-# The Cape
-http://www.simplecd.org/id/2147499824
-# Perfect Couples
-http://www.simplecd.org/id/2147499822
-# Community
-http://www.simplecd.org/id/2147500452
+http://www.simplecd.org/id/2853113
#TBBT4
http://www.simplecd.org/id/2147500415
#《左右不逢源 第二季》(The Middle Season 2)
http://www.simplecd.org/id/2853333
-#《抵抗分子 第一季》
-http://www.simplecd.org/id/2870596
-# Outsourced
-http://www.simplecd.org/id/2147500417
-#《超感神探 第三季》
-http://www.simplecd.org/id/2854180
-#《非凡家庭 第一季
-http://www.simplecd.org/id/2854275
-# [欧美] 《摩登家庭 第二季》(Modern Family S2)破烂熊字幕组
-http://www.simplecd.org/id/2147500443

0 comments on commit e81cbe8

Please sign in to comment.