Showing
4 changed files
with
3 additions
and
87 deletions
tests/add.diff
deleted
100644 → 0
1 | -diff --git a/codebert/code.py b/codebert/code.py | ||
2 | -new file mode 100644 | ||
3 | -index 0000000..b4bc953 | ||
4 | ---- /dev/null | ||
5 | -+++ b/codebert/code.py | ||
6 | -@@ -0,0 +1,21 @@ | ||
7 | -+def dailymotion_download(url, output_dir='.', merge=True, info_only=False, **kwargs): | ||
8 | -+ | ||
9 | -+ html = get_content(rebuilt_url(url)) | ||
10 | -+ info = json.loads(match1(html, r'qualities":({.+?}),"')) | ||
11 | -+ title = match1(html, r'"video_title"\s*:\s*"([^"]+)"') or \ | ||
12 | -+ match1(html, r'"title"\s*:\s*"([^"]+)"') | ||
13 | -+ title = unicodize(title) | ||
14 | -+ | ||
15 | -+ for quality in ['1080','720','480','380','240','144','auto']: | ||
16 | -+ try: | ||
17 | -+ real_url = info[quality][1]["url"] | ||
18 | -+ if real_url: | ||
19 | -+ break | ||
20 | -+ except KeyError: | ||
21 | -+ pass | ||
22 | -+ | ||
23 | -+ mime, ext, size = url_info(real_url) | ||
24 | -+ | ||
25 | -+ print_info(site_info, title, mime, size) | ||
26 | -+ if not info_only: | ||
27 | -+ download_urls([real_url], title, ext, size, output_dir=output_dir, merge=merge) | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
tests/fixed.diff
deleted
100644 → 0
1 | -diff --git a/src/train/model.py b/src/train/model.py | ||
2 | -index 20e56b3..cab82e5 100644 | ||
3 | ---- a/src/train/model.py | ||
4 | -+++ b/src/train/model.py | ||
5 | -@@ -3,9 +3,7 @@ | ||
6 | - | ||
7 | - import torch | ||
8 | - import torch.nn as nn | ||
9 | --import torch | ||
10 | --from torch.autograd import Variable | ||
11 | --import copy | ||
12 | -+ | ||
13 | - class Seq2Seq(nn.Module): | ||
14 | - """ | ||
15 | - Build Seqence-to-Sequence. | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
tests/mixed.diff
deleted
100644 → 0
1 | -diff --git a/codebert/code.py b/codebert/code.py | ||
2 | -new file mode 100644 | ||
3 | -index 0000000..b4bc953 | ||
4 | ---- /dev/null | ||
5 | -+++ b/codebert/code.py | ||
6 | -@@ -0,0 +1,21 @@ | ||
7 | -+def dailymotion_download(url, output_dir='.', merge=True, info_only=False, **kwargs): | ||
8 | -+ | ||
9 | -+ html = get_content(rebuilt_url(url)) | ||
10 | -+ info = json.loads(match1(html, r'qualities":({.+?}),"')) | ||
11 | -+ title = match1(html, r'"video_title"\s*:\s*"([^"]+)"') or \ | ||
12 | -+ match1(html, r'"title"\s*:\s*"([^"]+)"') | ||
13 | -+ title = unicodize(title) | ||
14 | -+ | ||
15 | -+ for quality in ['1080','720','480','380','240','144','auto']: | ||
16 | -+ try: | ||
17 | -+ real_url = info[quality][1]["url"] | ||
18 | -+ if real_url: | ||
19 | -+ break | ||
20 | -+ except KeyError: | ||
21 | -+ pass | ||
22 | -+ | ||
23 | -+ mime, ext, size = url_info(real_url) | ||
24 | -+ | ||
25 | -+ print_info(site_info, title, mime, size) | ||
26 | -+ if not info_only: | ||
27 | -+ download_urls([real_url], title, ext, size, output_dir=output_dir, merge=merge) | ||
28 | -diff --git a/src/train/model.py b/src/train/model.py | ||
29 | -index 20e56b3..cab82e5 100644 | ||
30 | ---- a/src/train/model.py | ||
31 | -+++ b/src/train/model.py | ||
32 | -@@ -3,9 +3,7 @@ | ||
33 | - | ||
34 | - import torch | ||
35 | - import torch.nn as nn | ||
36 | --import torch | ||
37 | --from torch.autograd import Variable | ||
38 | --import copy | ||
39 | -+ | ||
40 | - class Seq2Seq(nn.Module): | ||
41 | - """ | ||
42 | - Build Seqence-to-Sequence. | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment